Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-29 09:55:25 +0300
committerJunio C Hamano <junkio@cox.net>2005-11-29 09:55:25 +0300
commit9ef2b3cbf62d15aa0312bde349347873d7c0f399 (patch)
tree80083c23c526bb58f12fd3895887cf57a8db3a16 /ls-tree.c
parentffb1a4bed55534e276a0e4fc7dc1c94d17be8579 (diff)
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 d9f15e349c..d7c7e750fb 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);
}