summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1995-03-12 22:32:14 -0800
committerLarry Wall <lwall@netlabs.com>1995-03-12 22:32:14 -0800
commit748a93069b3d16374a9859d1456065dd3ae11394 (patch)
tree308ca14de9933a313dceacce8be77db67d9368c7 /regexec.c
parentfec02dd38faf8f83471b031857d89cb76fea1ca0 (diff)
downloadperl-748a93069b3d16374a9859d1456065dd3ae11394.tar.gz
Perl 5.001perl-5.001
[See the Changes file for a list of changes]
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 3992aafcdc..4621990d6f 100644
--- a/regexec.c
+++ b/regexec.c
@@ -852,10 +852,15 @@ char *prog;
if (OP(next) != BRANCH) /* No choice. */
next = NEXTOPER(scan);/* Avoid recursion. */
else {
+ int lastparen = *reglastparen;
do {
reginput = locinput;
if (regmatch(NEXTOPER(scan)))
return 1;
+ for (n = *reglastparen; n > lastparen; n--)
+ regendp[n] = 0;
+ *reglastparen = n;
+
#ifdef REGALIGN
/*SUPPRESS 560*/
if (n = NEXT(scan))
@@ -908,6 +913,7 @@ char *prog;
if (regmatch(next))
return 1;
/* Couldn't or didn't -- back up. */
+ reginput = locinput + ln;
if (regrepeat(scan, 1)) {
ln++;
reginput = locinput + ln;