summaryrefslogtreecommitdiffstats
path: root/lib/libcompat/4.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcompat/4.3')
-rw-r--r--lib/libcompat/4.3/regex.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libcompat/4.3/regex.c b/lib/libcompat/4.3/regex.c
index 89d6400..9b96978 100644
--- a/lib/libcompat/4.3/regex.c
+++ b/lib/libcompat/4.3/regex.c
@@ -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)
OpenPOWER on IntegriCloud