Skip to content

Commit

Permalink
Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint
Browse files Browse the repository at this point in the history
* jm/maint-1.6.5-grep-NUL-terminate:
  grep: NUL terminate input from a file
  • Loading branch information
Junio C Hamano committed Jan 19, 2010
2 parents b9cb077 + 34f3999 commit 7d0dafe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin-grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7d0dafe

Please sign in to comment.