summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds-fi-du.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-fi-du.c b/cmds-fi-du.c
index 8a44665c..7e6bb7f6 100644
--- a/cmds-fi-du.c
+++ b/cmds-fi-du.c
@@ -449,7 +449,7 @@ static int du_add_file(const char *filename, int dirfd,
}
pathtmp = pathp;
- if (pathp == path)
+ if (pathp == path || *(pathp - 1) == '/')
ret = sprintf(pathp, "%s", filename);
else
ret = sprintf(pathp, "/%s", filename);