Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint
author
Junio C Hamano
<gitster@pobox.com>
Tue, 19 Jan 2010 01:03:34 +0000
(17:03 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 19 Jan 2010 01:03:34 +0000
(17:03 -0800)
* jm/maint-1.6.5-grep-NUL-terminate:
grep: NUL terminate input from a file
builtin-grep.c
patch
|
blob
|
history
raw
(from parent 1:
b9cb077
)
diff --git
a/builtin-grep.c
b/builtin-grep.c
index af6c6fe8a7ed677de84cdbd828e8daae0a6bb12d..c7d74fbb7fe26840d4084ad3fef2c8fd4674df6e 100644
(file)
--- 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);