aboutsummaryrefslogtreecommitdiff
path: root/ls-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-28 22:55:25 -0800
committerJunio C Hamano <junkio@cox.net>2005-11-28 22:55:25 -0800
commit9ef2b3cbf62d15aa0312bde349347873d7c0f399 (patch)
tree80083c23c526bb58f12fd3895887cf57a8db3a16 /ls-tree.c
parentffb1a4bed55534e276a0e4fc7dc1c94d17be8579 (diff)
downloadgit-9ef2b3cbf62d15aa0312bde349347873d7c0f399.tar.gz
git-9ef2b3cbf62d15aa0312bde349347873d7c0f399.tar.xz
write_name_quoted(): make one of the path a counted string.
This is to prepare for ls-tree updates. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ls-tree.c')
-rw-r--r--ls-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ls-tree.c b/ls-tree.c
index d9f15e349..d7c7e750f 100644
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -157,9 +157,11 @@ static int show_entry(struct tree_entry_list *e, int level, char *pathbuf)
int err = 0;
if (e != &root_entry) {
+ int pathlen = strlen(pathbuf);
printf("%06o %s %s ",
e->mode, entry_type(e), entry_hex(e));
- write_name_quoted(pathbuf, e->name, line_termination, stdout);
+ write_name_quoted(pathbuf, pathlen, e->name,
+ line_termination, stdout);
putchar(line_termination);
}