projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18b14e5
)
Only add / in dirtree_path if it hasn't already got one, spotted by Ashwini Sharma.
author
Rob Landley
<rob@landley.net>
Wed, 18 Jul 2012 05:19:08 +0000
(
00:19
-0500)
committer
Rob Landley
<rob@landley.net>
Wed, 18 Jul 2012 05:19:08 +0000
(
00:19
-0500)
lib/dirtree.c
patch
|
blob
|
history
diff --git
a/lib/dirtree.c
b/lib/dirtree.c
index
664588d
..
3f5a293
100644
(file)
--- 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;