4aa2c4753d (grep: -W: don't extend context to trailing empty lines,
2016-05-28) stopped showing empty lines at the end of function context
when using -W. Do the same for trailing empty lines at the end of
files, for consistency -- it doesn't matter whether a function section
is ended by the next function or the end of the file.
Test it by adding a trailing empty line to the file used by the test
"grep -W" and leave its expected output the same.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 ||
return 0;
/* char ?? */
}
+
EOF
test_expect_success setup '