summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-27 17:14:39 +0200
committerNicholas Clark <nick@ccl4.org>2011-07-01 14:05:40 +0200
commit56e9eeb1a239fc995bf33475e31f8379bd01cbad (patch)
tree6cbb3b168a951fe169e6873a5cf01b590ec7da69 /regexec.c
parent0177730e7e0c099d1250571eb39367a76e2d91eb (diff)
downloadperl-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 6ae2770be5..00fc7124f6 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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) ))