aboutsummaryrefslogtreecommitdiff
path: root/lib/dirtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dirtree.c')
-rw-r--r--lib/dirtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c
index 9712ee14..37581829 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -90,7 +90,7 @@ char *dirtree_path(struct dirtree *node, int *plen)
ll = len = plen ? *plen : 0;
for (nn = node; nn; nn = nn->parent) if (*nn->name) len += strlen(nn->name)+1;
if (plen) *plen = len;
- if (!len) return 0;
+ if (!len) return xstrdup("");
path = xmalloc(len)+len-ll;
for (nn = node; nn; nn = nn->parent) if ((len = strlen(nn->name))) {
*--path = '/'*(nn != node);