aboutsummaryrefslogtreecommitdiff
path: root/jimregexp.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-11-10 23:05:17 +1000
committerSteve Bennett <steveb@workware.net.au>2010-11-17 07:57:39 +1000
commit8703da4f1ab22762b824ecd0822cbddc9b340770 (patch)
tree4f2684bb301a858262c83fde62395664894f4c18 /jimregexp.c
parent25f1f42a140db15e451afc473d802bc87170d172 (diff)
downloadjimtcl-8703da4f1ab22762b824ecd0822cbddc9b340770.zip
jimtcl-8703da4f1ab22762b824ecd0822cbddc9b340770.tar.gz
jimtcl-8703da4f1ab22762b824ecd0822cbddc9b340770.tar.bz2
Fix a regexec() bug
An anchored search could use the wrong string Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jimregexp.c')
-rw-r--r--jimregexp.c4
1 files changed, 2 insertions, 2 deletions
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;