Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix segmentation fault when registring devel/qmake
Baptiste Daroussin committed 14 years ago
commit ead5e4c4833443ac0c16b9322094075fad209537
parent 2b4147d
1 file changed +10 -3
modified libpkg/pkg_ports.c
@@ -86,11 +86,9 @@ ports_parse_plist(struct pkg *pkg, char *plist)
					if (STARTS_WITH(cmd, "rmdir ")) {
						comment[0] = '#';
						comment[1] = '\0';
-
						cmd += 6;
					} else if (STARTS_WITH(cmd, "/bin/rmdir ")) {
						comment[0] = '#';
						comment[1] = '\0';
-
						cmd += 11;
					}
					if (sbuf_len(unexec_scripts) == 0)
						sbuf_cat(unexec_scripts, "#@unexec\n"); /* to be able to regenerate the @unexec in pkg2legacy */
@@ -98,8 +96,17 @@ ports_parse_plist(struct pkg *pkg, char *plist)

					/* workaround to detect the @dirrmtry */
					if (comment[0] == '#') {
-
						buf =strchr(cmd, ' ');
+
						while (!isspace(cmd[0]))
+
							cmd++;
+

+
						while (isspace(cmd[0]))
+
							cmd++;
+

+
						buf = cmd;
+
						while (!isspace(buf[0]) && buf[0] != '\0')
+
							buf++;
						buf[0] = '\0';
+

						while (cmd[0] == '\"')
							cmd++;