Add sanity check for "no previous regular expression" state,
bringed by 'more'
This commit is contained in:
parent
28d8923ed0
commit
a7f57b7141
@ -59,8 +59,11 @@ char *
|
||||
re_comp(s)
|
||||
char *s;
|
||||
{
|
||||
if (s == NULL || *s == '\0')
|
||||
if (s == NULL || *s == '\0') {
|
||||
if (re_regexp == NULL)
|
||||
return "no previous regular expression";
|
||||
return (NULL);
|
||||
}
|
||||
if (re_regexp)
|
||||
free(re_regexp);
|
||||
if (re_errstr)
|
||||
|
Loading…
Reference in New Issue
Block a user