diff options
author | Andreas Karrer <karrer@ife.ee.ethz.ch> | 1997-06-11 12:00:00 +1200 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-06-11 12:00:00 +1200 |
commit | c8756f30ff24381844a7b05f062074a87dc23910 (patch) | |
tree | bf33f63a7a9d984c29f5c16d855dbb9d29415524 /regexec.c | |
parent | e860bb06317b0d55a48f2c5511900c366344d898 (diff) | |
download | perl-c8756f30ff24381844a7b05f062074a87dc23910.tar.gz |
Regex Bug in 5.003_26 thru 003_99a
According to Tom Christiansen:
> I just *knew* I should have included stuff from my FMTEYEWTK on regexen
> in the regression suites. You'll note that you've now rendered p71 of
> the Camel a liar. This is considered Very Naughty.
*sigh* Well, without a bug report, what I could I do?...
> I'd say this is a must-fix.
Here's a patch. I suppose this should go into _01.
p5p-msgid: 199705161915.PAA18721@rio.atlantic.net
Signed-off-by: Chip Salzenberg <chip@atlantic.net>
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -825,7 +825,11 @@ char *prog; sayNO; nextchar = UCHARAT(++locinput); break; + case REFFL: + regtainted = TRUE; + /* FALL THROUGH */ case REF: + case REFF: n = ARG1(scan); /* which paren pair */ s = regstartp[n]; if (!s) @@ -835,12 +839,19 @@ char *prog; if (s == regendp[n]) break; /* Inline the first character, for speed. */ - if (UCHARAT(s) != nextchar) + if (UCHARAT(s) != nextchar && + (OP(scan) == REF || + (UCHARAT(s) != ((OP(scan) == REFF + ? fold : fold_locale)[nextchar])))) sayNO; ln = regendp[n] - s; if (locinput + ln > regeol) sayNO; - if (ln > 1 && memNE(s, locinput, ln)) + if (ln > 1 && (OP(scan) == REF + ? memNE(s, locinput, ln) + : (OP(scan) == REFF + ? ibcmp(s, locinput, ln) + : ibcmp_locale(s, locinput, ln)))) sayNO; locinput += ln; nextchar = UCHARAT(locinput); |