From 9d0db7e2a3efaef49d7f40770f58e4919cde2711 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 23 Aug 2021 22:29:11 -0700 Subject: Instead of always printing all context with -r flag, always print all context with handling piped in input --- bp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- cgit v1.2.3