Repeating a search for a pattern that did not found made more(1) to
crash. To reproduce 'more /etc/services' and search for 'doom'; you will
find a service in port 666 - pressing '.' after that result used to cause
core dump.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
context.line = saveln = Currline;
context.chrctr = startline;
lncount = 0;
+ if (!buf)
+ goto notfound;
if ((rc = regcomp(&re, buf, REG_NOSUB)) != 0) {
char s[REGERR_BUF];
regerror(rc, &re, s, sizeof s);
}
free(previousre);
previousre = NULL;
+notfound:
more_error(_("Pattern not found"));
}
}