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:
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);
|
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;
|
show_function = 0;
|
||||||
}
|
}
|
||||||
if (show_function ||
|
if (show_function ||
|
||||||
|
@ -31,6 +31,7 @@ int main(int argc, const char **argv)
|
|||||||
return 0;
|
return 0;
|
||||||
/* char ?? */
|
/* char ?? */
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_expect_success setup '
|
test_expect_success setup '
|
||||||
|
Reference in New Issue
Block a user