From: Junio C Hamano Date: Wed, 16 Dec 2015 22:03:06 GMT Subject: [PATCH v2 05/17] mktree: read textual tree representation with strbuf_getline_crlf() Message-ID: <1450303398-25900-6-git-send-email-gitster@pobox.com> In-Reply-To: <1450303398-25900-1-git-send-email-gitster@pobox.com> The input can come from a DOS editor. Signed-off-by: Junio C Hamano --- builtin/mktree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/mktree.c b/builtin/mktree.c index a964d6b..c6cafb6 100644 --- a/builtin/mktree.c +++ b/builtin/mktree.c @@ -157,7 +157,9 @@ int cmd_mktree(int ac, const char **av, const char *prefix) while (!got_eof) { while (1) { - if (strbuf_getline(&sb, stdin, line_termination) == EOF) { + if ((line_termination + ? strbuf_getline_crlf(&sb, stdin) + : strbuf_getline(&sb, stdin, '\0')) == EOF) { got_eof = 1; break; } -- 2.7.0-rc1-83-ga8b6b9e