diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-19 04:03:34 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-19 04:03:34 +0300 |
commit | 7d0dafe3945408aeef9c2e5256ac926976170e54 (patch) | |
tree | 01187d82cec0dfc4d72bbcf42a35abb4a27ca6ed | |
parent | b9cb07726a7a288244b585939850348f319e5e0c (diff) | |
parent | 34f3999206e8ea41b9e4cf48e30ab1149e01d8a5 (diff) |
Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint
* jm/maint-1.6.5-grep-NUL-terminate:
grep: NUL terminate input from a file
-rw-r--r-- | builtin-grep.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c index af6c6fe8a7..c7d74fbb7f 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -205,6 +205,7 @@ static int grep_file(struct grep_opt *opt, const char *filename) return 0; } close(i); + data[sz] = 0; if (opt->relative && opt->prefix_length) filename = quote_path_relative(filename, -1, &buf, opt->prefix); i = grep_buffer(opt, filename, data, sz); |