Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Small code refactoring to avoid too many condition branches.
Alexandre Perrin committed 13 years ago
commit a60984bc7cfafb34f0aa160719dc4d002e320a94
parent bca4f54
1 file changed +3 -7
modified libpkg/pkg_ports.c
@@ -491,15 +491,11 @@ meta_exec(struct plist *p, char *line, struct file_attr *a, bool unexec)
	if (unexec) {
		comment[0] = '\0';
		/* workaround to detect the @dirrmtry */
-
		if (STARTS_WITH(cmd, "rmdir ")) {
+
		if (STARTS_WITH(cmd, "rmdir ") || STARTS_WITH(cmd, "/bin/rmdir ")) {
			comment[0] = '#';
			comment[1] = '\0';
-
		} else if (STARTS_WITH(cmd, "/bin/rmdir ")) {
-
			comment[0] = '#';
-
			comment[1] = '\0';
-
		}
-
		/* remove the glob if any */
-
		if (comment[0] == '#') {
+

+
			/* remove the glob if any */
			if (strchr(cmd, '*'))
				comment[0] = '\0';