[PATCH 14/17] column: read lines with strbuf_gets()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 28, 2015, 22:25 UTC
- Message-ID
- <1446071161-15610-15-git-send-email-gitster@pobox.com>
- In-Reply-To
- <1446071161-15610-1-git-send-email-gitster@pobox.com>
Multiple lines read here are concatenated on a single line to form a multi-column output line. We do not want to have a CR at the end, even if the input file consists of CRLF terminated lines.
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- builtin/column.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/column.c b/builtin/column.c index 449413c..e9fe928 100644 --- a/builtin/column.c +++ b/builtin/column.c @@ -51,7 +51,7 @@ int cmd_column(int argc, const char **argv, const char *prefix) die(_("--command must be the first argument")); } finalize_colopts(&colopts, -1); - while (!strbuf_getline(&sb, stdin, '\n')) + while (!strbuf_gets(&sb, stdin)) string_list_append(&list, sb.buf); print_columns(&list, colopts, &copts);
-- 2.6.2-423-g5314b62