aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-08-23 22:29:11 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-08-23 22:29:11 -0700
commit9d0db7e2a3efaef49d7f40770f58e4919cde2711 (patch)
tree2f39f4401b9bfac058c4e8d206a0334d60ed7b5f
parent7e04f59554d31d063d2a5dd901184ab2e32b30d0 (diff)
Instead of always printing all context with -r flag, always print all
context with handling piped in input
-rw-r--r--bp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bp.c b/bp.c
index f626628..d9aca3b 100644
--- a/bp.c
+++ b/bp.c
@@ -249,7 +249,7 @@ static int print_matches(FILE *out, def_t *defs, file_t *f, pat_t *pattern)
}
if (m) recycle_if_unused(&m);
- if (matches > 0 || (options.context_before == ALL_CONTEXT && options.context_after == ALL_CONTEXT)) {
+ if (matches > 0 || f->filename[0] == '\0') {
// Print trailing context lines:
print_match(out, &pr, NULL);
}