From eeec0acd0a92bf2e94b3168642faba92ba649178 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 30 Dec 2020 16:21:49 -0800 Subject: Don't print line numbers when dealing with piped-in input --- bpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bpeg.c') diff --git a/bpeg.c b/bpeg.c index 69b49ef..8c5f44a 100644 --- a/bpeg.c +++ b/bpeg.c @@ -112,7 +112,8 @@ static int run_match(grammar_t *g, const char *filename, vm_op_t *pattern, unsig else printf("%s:\n", filename); } - print_match(stdout, f, m, print_options); + print_match(stdout, f, m, + filename ? print_options : print_options & (print_options_t)~PRINT_LINE_NUMBERS); } destroy_file(&f); return 0; -- cgit v1.2.3