From: Junio C Hamano Date: Wed, 28 Oct 2015 22:25:48 GMT Subject: [PATCH 04/17] update-index: read list of paths with strbuf_gets() under --stdin Message-ID: <1446071161-15610-5-git-send-email-gitster@pobox.com> In-Reply-To: <1446071161-15610-1-git-send-email-gitster@pobox.com> Signed-off-by: Junio C Hamano --- builtin/update-index.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/update-index.c b/builtin/update-index.c index dfc65a8..004871b 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -1075,7 +1075,10 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT; setup_work_tree(); - while (strbuf_getline(&buf, stdin, line_termination) != EOF) { + + while ((line_termination + ? strbuf_gets(&buf, stdin) + : strbuf_getline(&buf, stdin, '\0')) != EOF) { char *p; if (line_termination && buf.buf[0] == '"') { strbuf_reset(&nbuf); -- 2.6.2-423-g5314b62