Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Do not try to add empty option name to the struct pkg when parsing plist
Baptiste Daroussin committed 13 years ago
commit 272fd2a8f37a49a2ca86d401a1acb4c392467128
parent aa56a7213eca5695daf6b0db749e9c1c64b519ee
1 file changed +4 -2
modified libpkg/pkg_ports.c
@@ -393,6 +393,7 @@ static int
comment_key(struct plist *p, char *line, struct file_attr *a)
{
	char *name, *version, *line_options, *option;
+

	if (strncmp(line, "DEPORIGIN:", 10) == 0) {
		line += 10;
		name = p->pkgdep;
@@ -410,8 +411,9 @@ comment_key(struct plist *p, char *line, struct file_attr *a)
		if (line[0] != '\0') {
			line_options = strdup(line);
			while ((option = strsep(&line_options, " ")) != NULL) {
-
				pkg_addoption(p->pkg, option + 1,
-
				    option[0] == '+' ? "on" : "off");
+
				if (strlen(option) > 0)
+
					pkg_addoption(p->pkg, option + 1,
+
					    option[0] == '+' ? "on" : "off");
			}
			free(line_options);
		}