Fix infinite loop in API function string_has_highlight_regex if regex is empty
parent
b4d58dd9da
commit
ce269387a5
|
@ -766,7 +766,7 @@ string_has_highlight_regex (const char *string, const char *regex)
|
|||
regex_t reg;
|
||||
int rc;
|
||||
|
||||
if (!string || !regex)
|
||||
if (!string || !regex || !regex[0])
|
||||
return 0;
|
||||
|
||||
if (regcomp (®, regex, REG_EXTENDED) != 0)
|
||||
|
|
Loading…
Reference in New Issue