mirror of
https://github.com/git/git
synced 2024-09-30 05:37:04 +00:00
Merge branch 'rs/grep-omit-blank-lines-after-function-at-eof'
"git grep -W" omits blank lines that follow the found function at the end of the file, just like it omits blank lines before the next function. * rs/grep-omit-blank-lines-after-function-at-eof: grep: -W: skip trailing empty lines at EOF, too
This commit is contained in:
commit
984ab11337
3
grep.c
3
grep.c
|
@ -1735,7 +1735,8 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
|
|||
peek_eol = end_of_line(peek_bol, &peek_left);
|
||||
}
|
||||
|
||||
if (match_funcname(opt, gs, peek_bol, peek_eol))
|
||||
if (peek_bol >= gs->buf + gs->size ||
|
||||
match_funcname(opt, gs, peek_bol, peek_eol))
|
||||
show_function = 0;
|
||||
}
|
||||
if (show_function ||
|
||||
|
|
|
@ -31,6 +31,7 @@ int main(int argc, const char **argv)
|
|||
return 0;
|
||||
/* char ?? */
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
test_expect_success setup '
|
||||
|
|
Loading…
Reference in a new issue