Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Remove begin and end spaces from file path
Baptiste Daroussin committed 15 years ago
commit 7969de53bf82227887b9785dc1e8d9092a1c1c17
parent ebe1e484357c38daaa27bb5fd4d33a0ac3aea21f
1 file changed +10 -0
modified libpkg/pkg_ports.c
@@ -95,6 +95,9 @@ ports_parse_plist(struct pkg *pkg, char *plist)
				while (isspace(buf[0]))
					buf++;

+
				while (isspace(buf[strlen(buf) -1]))
+
					buf[strlen(buf) - 1] = '\0';
+

				if (prefix[strlen(prefix) -1 ] == '/')
					snprintf(path, MAXPATHLEN, "%s%s/", prefix, buf);
				else
@@ -113,6 +116,13 @@ ports_parse_plist(struct pkg *pkg, char *plist)
			last_plist_file = buf;
			sha256[0] = '\0';

+
			/* remove spaces at the begining and at the end */
+
			while (isspace(buf[0]))
+
				buf++;
+

+
			while (isspace(buf[strlen(buf) -1]))
+
				buf[strlen(buf) - 1] = '\0';
+

			if (prefix[strlen(prefix) - 1] == '/')
				snprintf(path, MAXPATHLEN, "%s%s", prefix, buf);
			else