From: Junio C Hamano Date: Tue, 19 Jan 2010 01:03:34 +0000 (-0800) Subject: Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint X-Git-Tag: v1.6.6.1~8 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7d0dafe3945408aeef9c2e5256ac926976170e54;hp=b9cb07726a7a288244b585939850348f319e5e0c;p=git.git 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 --- diff --git a/builtin-grep.c b/builtin-grep.c index af6c6fe8a..c7d74fbb7 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);