summaryrefslogtreecommitdiff
path: root/ls-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-10-14 21:56:46 -0700
committerJunio C Hamano <junkio@cox.net>2005-10-17 17:41:55 -0700
commit22ddf7197958337a8c254122eae4efcd8a54098a (patch)
tree425970bac6109c4b5d541ffb62adb7a570822ae9 /ls-tree.c
parent22943f1a52142b0ef669c959f8b4367e579da968 (diff)
downloadgit-22ddf7197958337a8c254122eae4efcd8a54098a.tar.gz
Update ls-files and ls-tree to use C-style quoting for funny pathnames.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ls-tree.c')
-rw-r--r--ls-tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ls-tree.c b/ls-tree.c
index dd642e0bf0..d9f15e349c 100644
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -6,6 +6,7 @@
#include "cache.h"
#include "blob.h"
#include "tree.h"
+#include "quote.h"
static int line_termination = '\n';
#define LS_RECURSIVE 1
@@ -156,8 +157,9 @@ static int show_entry(struct tree_entry_list *e, int level, char *pathbuf)
int err = 0;
if (e != &root_entry) {
- printf("%06o %s %s %s%s", e->mode, entry_type(e),
- entry_hex(e), pathbuf, e->name);
+ printf("%06o %s %s ",
+ e->mode, entry_type(e), entry_hex(e));
+ write_name_quoted(pathbuf, e->name, line_termination, stdout);
putchar(line_termination);
}