Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-19 04:03:34 +0300
committerJunio C Hamano <gitster@pobox.com>2010-01-19 04:03:34 +0300
commit7d0dafe3945408aeef9c2e5256ac926976170e54 (patch)
tree01187d82cec0dfc4d72bbcf42a35abb4a27ca6ed /builtin-grep.c
parentb9cb07726a7a288244b585939850348f319e5e0c (diff)
parent34f3999206e8ea41b9e4cf48e30ab1149e01d8a5 (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
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c1
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);