summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-02-09 10:07:47 -0700
committerKarl Williamson <public@khwilliamson.com>2011-02-14 08:41:37 -0700
commit4e8910e0d628df764d87388af5830fb98b646135 (patch)
tree5feed1d89030949a521c447640f8de42d8d78ec8 /regexec.c
parent046c40559dca334dd19ab80f11964b107b2dbcef (diff)
downloadperl-4e8910e0d628df764d87388af5830fb98b646135.tar.gz
regexec.c: Give context for ANYOFV call
This converts one case where ANYOFV is now usable to allow it to match more than one character.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index e0d27eaa4d..8886c25712 100644
--- a/regexec.c
+++ b/regexec.c
@@ -6085,11 +6085,15 @@ S_regrepeat(pTHX_ const regexp *prog, const regnode *p, I32 max, int depth)
break;
case ANYOFV:
case ANYOF:
- if (utf8_target) {
+ if (utf8_target || OP(p) == ANYOFV) {
+ STRLEN inclasslen;
loceol = PL_regeol;
- while (hardcount < max && scan < loceol &&
- reginclass(prog, p, (U8*)scan, 0, utf8_target)) {
- scan += UTF8SKIP(scan);
+ inclasslen = loceol - scan;
+ while (hardcount < max
+ && ((inclasslen = loceol - scan) > 0)
+ && reginclass(prog, p, (U8*)scan, &inclasslen, utf8_target))
+ {
+ scan += inclasslen;
hardcount++;
}
} else {