Re: [PATCH v14 05/16] Refactor write_name_quoted_relative, remove unused params

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v14 05/16] Refactor write_name_quoted_relative, remove unused params

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:54

Jiang Xin [off-list ref] writes:
-static void write_name(const char* name, size_t len)
+static void write_name(const char *name)
 {
-	write_name_quoted_relative(name, len, prefix, prefix_len, stdout,
-			line_terminator);
+
+	/* turn off prefix, if run with "--full-name" */
+	write_name_quoted_relative(name, prefix_len ? prefix : NULL,
+				   stdout, line_terminator);
Hmmm....

Does this mean that ls-files has been broken in 03/16, because
write_name_quoted_relative() was made to ignore prefix_len and
measure the length of prefix with strlen(prefix), and this change
fixes it?

Re: [PATCH v14 05/16] Refactor write_name_quoted_relative, remove unused params

From: Jiang Xin <hidden>
Date: 2016-06-15 22:57:55

2013/6/25 Junio C Hamano [off-list ref]:
Jiang Xin [off-list ref] writes:
quoted
-static void write_name(const char* name, size_t len)
+static void write_name(const char *name)
 {
-     write_name_quoted_relative(name, len, prefix, prefix_len, stdout,
-                     line_terminator);
+
+     /* turn off prefix, if run with "--full-name" */
+     write_name_quoted_relative(name, prefix_len ? prefix : NULL,
+                                stdout, line_terminator);
Hmmm....

Does this mean that ls-files has been broken in 03/16, because
write_name_quoted_relative() was made to ignore prefix_len and
measure the length of prefix with strlen(prefix), and this change
fixes it?
I will rewrite and move this chunk to patch 03/16, but leave others
in this patch for clearity.


-- 
蒋鑫

北京群英汇信息技术有限公司
邮件: worldhello.net@gmail.com
网址: http://www.ossxp.com/
博客: http://www.worldhello.net/
微博: http://weibo.com/gotgit/
电话: 18601196889
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help