Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH] ls-tree: Resurrect funny name quoting lost during rewrite.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:13
Subsystem: the rest · Maintainer: Linus Torvalds

The rewrite to match ls-files/diff-tree behaviour accidentally
lost the name quoting.  I am not proud about this code, but this
would get the test going.

Signed-off-by: Junio C Hamano <redacted>

---

 ls-tree.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

applies-to: 4db95789ce3af40091ead2a97a72e75f9a0b8384
e7cdcbbbbd2fd2848244f998a0b92338fc68fe78
diff --git a/ls-tree.c b/ls-tree.c
index 4df5830..df3bcec 100644
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -48,7 +48,15 @@ static int show_tree(unsigned char *sha1
 		type = "tree";
 	}
 
-	printf("%06o %s %s\t%.*s%s%c", mode, type, sha1_to_hex(sha1), baselen, base, pathname, line_termination);
+	printf("%06o %s %s\t", mode, type, sha1_to_hex(sha1));
+	if (1) {
+		/* NEEDSWORK: */
+		char base_[baselen + 1];
+		memcpy(base_, base, baselen);
+		base_[baselen] = 0;
+		write_name_quoted(base_, pathname, line_termination, stdout);
+	}
+	putchar(line_termination);
 	return 0;
 }
 
---
0.99.9.GIT
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help