diff options
Diffstat (limited to 'lib/dirtree.c')
-rw-r--r-- | lib/dirtree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c index 664588d8..3f5a2935 100644 --- a/lib/dirtree.c +++ b/lib/dirtree.c @@ -60,7 +60,7 @@ char *dirtree_path(struct dirtree *node, int *plen) len = (plen ? *plen : 0)+strlen(node->name)+1; path = dirtree_path(node->parent, &len); - if (len) path[len++]='/'; + if (len && path[len-1] != '/') path[len++]='/'; len = (stpcpy(path+len, node->name) - path); if (plen) *plen = len; |