diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1999-02-07 12:00:10 -0500 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-07 23:27:32 +0000 |
commit | e60df1faf6a2408e6441d757a835423e1efdcc95 (patch) | |
tree | 4c7f5508792e61a1c8da9af75c025262a2971879 /pp_hot.c | |
parent | 4327152a8da835b489f2314100b405920cc614ea (diff) | |
download | perl-e60df1faf6a2408e6441d757a835423e1efdcc95.tar.gz |
Fix list-context //g with zero-length matches
Message-ID: <19990207170009.A894@monk.mps.ohio-state.edu>
p4raw-id: //depot/perl@2827
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -844,6 +844,7 @@ PP(pp_match) I32 minmatch = 0; I32 oldsave = PL_savestack_ix; I32 update_minmatch = 1; + I32 had_zerolen = 0; if (PL_op->op_flags & OPf_STACKED) TARG = POPs; @@ -907,7 +908,7 @@ play_it_again: if ((s + rx->minlen) > strend) goto nope; if (update_minmatch++) - minmatch = (s == rx->startp[0]); + minmatch = had_zerolen; } if (rx->check_substr) { if (!(rx->reganch & ROPT_NOSCAN)) { /* Floating checkstring. */ @@ -993,8 +994,7 @@ play_it_again: if (global) { truebase = rx->subbeg; strend = rx->subend; - if (rx->startp[0] && rx->startp[0] == rx->endp[0]) - ++rx->endp[0]; + had_zerolen = (rx->startp[0] && rx->startp[0] == rx->endp[0]); PUTBACK; /* EVAL blocks may use stack */ r_flags |= REXEC_IGNOREPOS; goto play_it_again; |