Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Properly trim end spaces in plist for files and directories
Baptiste Daroussin committed 11 years ago
commit 9b7aa825744e9e808bb2e4b0bf1dd1b61e075f7e
parent bf4a9a6
1 file changed +2 -2
modified libpkg/pkg_ports.c
@@ -275,7 +275,7 @@ meta_dirrm(struct plist *p, char *line, struct file_attr *a, bool try)
	len = strlen(line);

	while (isspace(line[len - 1]))
-
		line[len - 1] = '\0';
+
		line[--len] = '\0';

	if (line[0] == '/')
		snprintf(path, sizeof(path), "%s/", line);
@@ -344,7 +344,7 @@ file(struct plist *p, char *line, struct file_attr *a)
	len = strlen(line);

	while (isspace(line[len - 1]))
-
		line[len - 1] = '\0';
+
		line[--len] = '\0';

	if (line[0] == '/')
		snprintf(path, sizeof(path), "%s", line);