Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Do not try to add empty option name to the struct pkg when parsing plist
Baptiste Daroussin committed 13 years ago
commit 272fd2a8f37a49a2ca86d401a1acb4c392467128
parent aa56a72
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);
		}