summaryrefslogtreecommitdiff
path: root/io/ftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/ftw.c')
-rw-r--r--io/ftw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io/ftw.c b/io/ftw.c
index 18b60519f0..dc02ebf205 100644
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -398,7 +398,7 @@ ftw_dir (struct ftw_data *data, struct STAT *st)
startp = strchr (data->dirbuf, '\0');
/* There always must be a directory name. */
assert (startp != data->dirbuf);
- if (startp != data->dirbuf + 1)
+ if (startp[-1] != '/')
*startp++ = '/';
data->ftw.base = startp - data->dirbuf;