From 8703da4f1ab22762b824ecd0822cbddc9b340770 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 10 Nov 2010 23:05:17 +1000 Subject: Fix a regexec() bug An anchored search could use the wrong string Signed-off-by: Steve Bennett --- jimregexp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jimregexp.c') diff --git a/jimregexp.c b/jimregexp.c index 7a0adf2..146f544 100644 --- a/jimregexp.c +++ b/jimregexp.c @@ -1146,11 +1146,11 @@ int regexec(regex_t *preg, const char *string, size_t nmatch, regmatch_t pmat if (ret) { return REG_NOERROR; } - if (*preg->reginput) { + if (*string) { nextline: if (preg->cflags & REG_NEWLINE) { /* Try the next anchor? */ - string = strchr(preg->reginput, '\n'); + string = strchr(string, '\n'); if (string) { preg->regbol = ++string; continue; -- cgit v1.1