commit 95e2eedad44169af2093992804253083a4a21844
parent f4eb14a866e08e3b2e8faca270a8bff45051a4c5
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 1 Sep 2021 14:32:18 -0700
Clean target paths in installation program
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/module.c b/lib/module.c
@@ -145,8 +145,11 @@ usage:
arglen = 0;
while ((ent = fts_read(fts))) {
- if (!argtoo && ent->fts_level == 0 && ent->fts_info == FTS_D)
+ if (!argtoo && ent->fts_level == 0 && ent->fts_info == FTS_D) {
arglen = strlen(ent->fts_path);
+ if (ent->fts_path[arglen - 1] != '/')
+ ++arglen;
+ }
if (snprintf(new, sizeof(new), "%s/%s", prefix, ent->fts_path + arglen) >= sizeof(new)) {
errno = ENAMETOOLONG;
die(ent->fts_path);