mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
PCRE - add error handling
This commit is contained in:
parent
27617c0446
commit
e2d37632ea
1 changed files with 6 additions and 2 deletions
|
@ -1884,8 +1884,12 @@ static int regflags = REG_NOSUB | REG_EXTENDED | REG_ICASE;
|
||||||
#ifdef PCRE
|
#ifdef PCRE
|
||||||
static int setfilter(pcre **pcrex, const char *filter)
|
static int setfilter(pcre **pcrex, const char *filter)
|
||||||
{
|
{
|
||||||
*pcrex = pcre_compile(filter, pcreflags, NULL, NULL, NULL);
|
const char *errstr = NULL;
|
||||||
return *pcrex ? 0 : -1;
|
int erroffset = 0;
|
||||||
|
|
||||||
|
*pcrex = pcre_compile(filter, pcreflags, &errstr, &erroffset, tables);
|
||||||
|
|
||||||
|
return errstr ? -1 : 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int setfilter(regex_t *regex, const char *filter)
|
static int setfilter(regex_t *regex, const char *filter)
|
||||||
|
|
Loading…
Add table
Reference in a new issue