aboutsummaryrefslogtreecommitdiff
path: root/bp.c
diff options
context:
space:
mode:
Diffstat (limited to 'bp.c')
-rw-r--r--bp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bp.c b/bp.c
index d9aca3b..6243fd2 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 || f->filename[0] == '\0') {
+ if (matches > 0 || (f->filename[0] == '\0' && options.context_before == ALL_CONTEXT)) {
// Print trailing context lines:
print_match(out, &pr, NULL);
}