Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix the package has no prefix, first time @cwd it will become the default pkg prefix
Baptiste Daroussin committed 13 years ago
commit af3594e65c722339e67ad736d2f7db2cf749cfdb
parent d69d3ec
1 file changed +7 -0
modified libpkg/pkg_ports.c
@@ -146,11 +146,18 @@ sbuf_append(struct sbuf *buf, __unused const char *comment, const char *str, ...
static int
setprefix(struct plist *p, char *line, struct file_attr *a)
{
+
	char *pkgprefix;
+

	/* if no arguments then set default prefix */
	if (line[0] == '\0')
		pkg_get(p->pkg, PKG_PREFIX, &p->prefix);
	else
		p->prefix = line;
+

+
	pkg_get(p->pkg, PKG_PREFIX, &pkgprefix);
+
	if (pkgprefix == NULL)
+
		pkg_set(p->pkg, PKG_PREFIX, line);
+

	p->slash = p->prefix[strlen(p->prefix) -1] == '/' ? "" : "/";

	free(a);