summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-03 14:15:58 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-03 14:15:58 -0800
commit017565525f969c26c43443d998a1283cac843d10 (patch)
tree32d6e0cac811a30e9a709cfb4720310436efc762 /builtin/grep.c
parent07c314d22dc8b0a982e76e7498a3f4d384062491 (diff)
parentf06068c96181f6212e15e32957a3d40c7c7bd43d (diff)
downloadgit-017565525f969c26c43443d998a1283cac843d10.tar.gz
Merge branch 'jc/peace-with-crlf'
Many commands that read files that are expected to contain text that is generated (or can be edited) by the end user to control their behaviour (e.g. "git grep -f <filename>") have been updated to be more tolerant to lines that are terminated with CRLF (they used to treat such a line to contain payload that ends with CR, which is usually not what the users expect). * jc/peace-with-crlf: test-sha1-array: read command stream with strbuf_getline() grep: read -f file with strbuf_getline() send-pack: read list of refs with strbuf_getline() column: read lines with strbuf_getline() cat-file: read batch stream with strbuf_getline() transport-helper: read helper response with strbuf_getline() clone/sha1_file: read info/alternates with strbuf_getline() remote.c: read $GIT_DIR/remotes/* with strbuf_getline() ident.c: read /etc/mailname with strbuf_getline() rev-parse: read parseopt spec with strbuf_getline() revision: read --stdin with strbuf_getline() hash-object: read --stdin-paths with strbuf_getline()
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 6c030dad6b..8c516a9543 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -573,7 +573,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset)
patterns = from_stdin ? stdin : fopen(arg, "r");
if (!patterns)
die_errno(_("cannot open '%s'"), arg);
- while (strbuf_getline_lf(&sb, patterns) == 0) {
+ while (strbuf_getline(&sb, patterns) == 0) {
/* ignore empty line like grep does */
if (sb.len == 0)
continue;