cat-file: read batch stream with strbuf_getline()
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Oct 2015 20:38:56 +0000 (13:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Jan 2016 18:35:06 +0000 (10:35 -0800)
It is possible to prepare a text file with a DOS editor and feed it
as a batch command stream to the command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/cat-file.c
index d2ebaf1f5857bbcc5f2a802472824a75ce5d5ccf..54db1184a003897294b6aaa46bc6bf29faa919bc 100644 (file)
@@ -401,7 +401,7 @@ static int batch_objects(struct batch_options *opt)
        save_warning = warn_on_object_refname_ambiguity;
        warn_on_object_refname_ambiguity = 0;
 
-       while (strbuf_getline_lf(&buf, stdin) != EOF) {
+       while (strbuf_getline(&buf, stdin) != EOF) {
                if (data.split_on_whitespace) {
                        /*
                         * Split at first whitespace, tying off the beginning