summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-08-21 01:41:02 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-09-23 05:50:36 +0000
commit708e3b054d184f1df89a7417419acad25ffa7318 (patch)
tree31fbf3b1823bb6aa7f879dfce392238ed0f18616 /regexec.c
parent5d42aa7bc9bf791efe4c2cf03a5b696d88d51458 (diff)
downloadperl-708e3b054d184f1df89a7417419acad25ffa7318.tar.gz
make behavior of /(a{3})+/ like /(aaa)+/ w.r.t where it matches
Message-Id: <199808210941.FAA16467@monk.mps.ohio-state.edu> Subject: Re: your mail p4raw-id: //depot/perl@1815
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 0627e2b154..2dac18d95a 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2546,14 +2546,14 @@ regrepeat_hard(regnode *p, I32 max, I32 *lp)
register char *start;
register char *loceol = PL_regeol;
I32 l = 0;
- I32 count = 0;
+ I32 count = 0, res = 1;
if (!max)
return 0;
start = PL_reginput;
if (UTF) {
- while (PL_reginput < loceol && (scan = PL_reginput, regmatch(p))) {
+ while (PL_reginput < loceol && (scan = PL_reginput, res = regmatch(p))) {
if (!count++) {
l = 0;
while (start < PL_reginput) {
@@ -2569,7 +2569,7 @@ regrepeat_hard(regnode *p, I32 max, I32 *lp)
}
}
else {
- while (PL_reginput < loceol && (scan = PL_reginput, regmatch(p))) {
+ while (PL_reginput < loceol && (scan = PL_reginput, res = regmatch(p))) {
if (!count++) {
*lp = l = PL_reginput - start;
if (max != REG_INFTY && l*max < loceol - scan)
@@ -2579,7 +2579,7 @@ regrepeat_hard(regnode *p, I32 max, I32 *lp)
}
}
}
- if (PL_reginput < loceol)
+ if (!res)
PL_reginput = scan;
return count;