diff options
author | Rob Landley <rob@landley.net> | 2020-10-03 02:34:23 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-10-03 02:34:23 -0500 |
commit | 07c316a2bbf0ad0f41229ca668def609a5f50f2c (patch) | |
tree | b213f3a3ac75a5e8b0101a82e109fce181c24de3 | |
parent | 424632aaa30e85e069678da8c413a35c4d321cf6 (diff) | |
download | toybox-07c316a2bbf0ad0f41229ca668def609a5f50f2c.tar.gz |
Return empty string for dirtree_path() of "" (instead of NULL).
-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 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); |