diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-20 12:16:46 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-20 12:16:46 -0800 |
commit | 27132ca85a74b65fe97cedab02f84f20050faa2d (patch) | |
tree | b0ee6a720379cad8001eb11901db2f58a622bc45 | |
parent | 03c6e97f809e5b89089a2c689d6a319e8d471455 (diff) | |
parent | 34f3999206e8ea41b9e4cf48e30ab1149e01d8a5 (diff) | |
download | git-27132ca85a74b65fe97cedab02f84f20050faa2d.tar.gz |
Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint-1.6.5
* 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 d79a6260a4..63dc31c45c 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -207,6 +207,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); |