{"thread":{"id":"3047","subject":"[PATCH - maint review] update-index: work with c-quoted name","startedAt":"2006-01-12T00:04:52Z","lastAt":"2006-01-12T00:04:52Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"14514","messageId":"7vbqyil3a3.fsf@assigned-by-dhcp.cox.net","threadId":"3047","inReplyTo":null,"subject":"[PATCH - maint review] update-index: work with c-quoted name","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-12T00:04:52Z","receivedAt":"2006-01-12T00:04:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"update-index --stdin did not work with c-style quoted names even though\nupdate-index --index-info did.  This fixes the inconsistency.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n * For 1.0.10 and 1.1.2\n\n update-index.c |    9 ++++++++-\n 1 files changed, 8 insertions(+), 1 deletions(-)\n\na94d9948da539fdafc26c74afb335b2fe9f8f21d\ndiff --git a/update-index.c b/update-index.c\nindex be87b99..a84a04f 100644\n--- a/update-index.c\n+++ b/update-index.c\n@@ -534,10 +534,17 @@ int main(int argc, const char **argv)\n \t\tstruct strbuf buf;\n \t\tstrbuf_init(&buf);\n \t\twhile (1) {\n+\t\t\tchar *path_name;\n \t\t\tread_line(&buf, stdin, line_termination);\n \t\t\tif (buf.eof)\n \t\t\t\tbreak;\n-\t\t\tupdate_one(buf.buf, prefix, prefix_length);\n+\t\t\tif (line_termination && buf.buf[0] == '\"')\n+\t\t\t\tpath_name = unquote_c_style(buf.buf, NULL);\n+\t\t\telse\n+\t\t\t\tpath_name = buf.buf;\n+\t\t\tupdate_one(path_name, prefix, prefix_length);\n+\t\t\tif (path_name != buf.buf)\n+\t\t\t\tfree(path_name);\n \t\t}\n \t}\n \tif (active_cache_changed) {\n-- \n1.1.1-g8ecb\n"}]}