diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-27 17:14:39 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-07-01 14:05:40 +0200 |
commit | 56e9eeb1a239fc995bf33475e31f8379bd01cbad (patch) | |
tree | 6cbb3b168a951fe169e6873a5cf01b590ec7da69 /regexec.c | |
parent | 0177730e7e0c099d1250571eb39367a76e2d91eb (diff) | |
download | perl-56e9eeb1a239fc995bf33475e31f8379bd01cbad.tar.gz |
Change PL_screamnext to store absolute positions.
PL_screamnext gives the position of the next occurrence of the current octet.
Previously it stored this as an offset from the current position, with -pos
stored for "no more", so that the calculated new offset would be zero,
allowing a zero/non-zero loop exit test in Perl_screaminstr().
Now it stores absolute position, with -1 for "no more". Also codify -1 as the
"not present" value for PL_screamfirst, instead of any negative value.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -696,7 +696,7 @@ Perl_re_intuit_start(pTHX_ REGEXP * const rx, SV *sv, char *strpos, I32 p = -1; /* Internal iterator of scream. */ I32 * const pp = data ? data->scream_pos : &p; - if (PL_screamfirst[BmRARE(check)] >= 0 + if (PL_screamfirst[BmRARE(check)] != -1 || ( BmRARE(check) == '\n' && (BmPREVIOUS(check) == SvCUR(check) - 1) && SvTAIL(check) )) |