Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Remove begin and end spaces from file path
Baptiste Daroussin committed 14 years ago
commit 7969de53bf82227887b9785dc1e8d9092a1c1c17
parent ebe1e48
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