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>
This commit is contained in:
Junio C Hamano
2005-11-28 22:55:25 -08:00
parent ffb1a4bed5
commit 9ef2b3cbf6
4 changed files with 29 additions and 16 deletions

View File

@ -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);
}