diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-08-21 01:41:02 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-09-23 05:50:36 +0000 |
commit | 708e3b054d184f1df89a7417419acad25ffa7318 (patch) | |
tree | 31fbf3b1823bb6aa7f879dfce392238ed0f18616 /regexec.c | |
parent | 5d42aa7bc9bf791efe4c2cf03a5b696d88d51458 (diff) | |
download | perl-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |