summaryrefslogtreecommitdiff
path: root/src/grep.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2020-10-04 09:39:39 -0700
committerJim Meyering <meyering@fb.com>2020-10-11 20:30:30 -0700
commitdf33ff807de40b131ba835ee4b0d27a0577a17ab (patch)
tree877177afbfe2d6c5b2805074d7a488fdac22a26a /src/grep.c
parentf31abf786f61f4bdd7134559a5f155fc9c8c2513 (diff)
downloadgrep-df33ff807de40b131ba835ee4b0d27a0577a17ab.tar.gz
grep: -P: report input filename upon PCRE execution failure
Without this, it could be tedious to determine which input file evokes a PCRE-execution-time failure. * src/pcresearch.c (Pexecute): When failing, include the error-provoking file name in the diagnostic. * src/grep.c (input_filename): Make extern, since used above. * src/search.h (input_filename): Declare. * tests/filename-lineno.pl: Test for this. ($no_pcre): Factor out. * NEWS (Bug fixes): Mention this.
Diffstat (limited to 'src/grep.c')
-rw-r--r--src/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/grep.c b/src/grep.c
index de7616a0..bd6ca53a 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -641,7 +641,7 @@ typedef size_t (*execute_fp_t) (void *, char const *, size_t, size_t *,
static execute_fp_t execute;
static void *compiled_pattern;
-static char const *
+char const *
input_filename (void)
{
if (!filename)