aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-24 19:00:12 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-24 19:00:45 +0530
commite2d37632eaa9599c344851cfeb9b77851cd97281 (patch)
treeea43b3022964644e1bd1bd78a3e7b32c489132a0 /src
parent27617c0446455ed416c5348080a1a3dbde9338c6 (diff)
downloadnnn-e2d37632eaa9599c344851cfeb9b77851cd97281.tar.gz
PCRE - add error handling
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 5005231..7278b85 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1884,8 +1884,12 @@ static int regflags = REG_NOSUB | REG_EXTENDED | REG_ICASE;
#ifdef PCRE
static int setfilter(pcre **pcrex, const char *filter)
{
- *pcrex = pcre_compile(filter, pcreflags, NULL, NULL, NULL);
- return *pcrex ? 0 : -1;
+ const char *errstr = NULL;
+ int erroffset = 0;
+
+ *pcrex = pcre_compile(filter, pcreflags, &errstr, &erroffset, tables);
+
+ return errstr ? -1 : 0;
}
#else
static int setfilter(regex_t *regex, const char *filter)