Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix appendscript
Baptiste Daroussin committed 13 years ago
commit 572ba74669ccb6e9921719853962c2593a334c8c
parent 32b5ce8
1 file changed +5 -8
modified libpkg/pkg.c
@@ -769,15 +769,12 @@ pkg_appendscript(struct pkg *pkg, const char *cmd, pkg_script type)
	assert(pkg != NULL);
	assert(cmd != NULL && cmd[0] != '\0');

-
	s = &pkg->scripts[type];
-

-
	if (s != NULL) {
-
		sbuf_cat(*s, cmd);
-
		sbuf_finish(*s);
-
		return (EPKG_OK);
-
	}
+
	if (pkg_script_get(pkg, type) == NULL)
+
		return (pkg_addscript(pkg, cmd, type));

-
	sbuf_set(s, cmd);
+
	s = &pkg->scripts[type];
+
	sbuf_cat(*s, cmd);
+
	sbuf_finish(*s);

	return (EPKG_OK);
}