diff options
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 22 |
1 files changed, 3 insertions, 19 deletions
@@ -97,6 +97,7 @@ #endif #define REGINCLASS(p,c) (ANYOF_FLAGS(p) ? reginclass(p,c,0,0) : ANYOF_BITMAP_TEST(p,*(c))) +#define REGINCLASS_utf8(p,c) (ANYOF_FLAGS(p) ? reginclass(p,c,0,1) : ANYOF_BITMAP_TEST(p,*(c))) /* * Forwards. @@ -4078,25 +4079,8 @@ S_regrepeat(pTHX_ regnode *p, I32 max) if (do_utf8) { loceol = PL_regeol; while (hardcount < max && scan < loceol) { - bool cont = FALSE; - if (ANYOF_FLAGS(p) & ANYOF_UNICODE) { - if (reginclass(p, (U8*)scan, 0, do_utf8)) - cont = TRUE; - } - else { - U8 c = (U8)scan[0]; - - if (UTF8_IS_INVARIANT(c)) { - if (ANYOF_BITMAP_TEST(p, c)) - cont = TRUE; - } - else { - if (reginclass(p, (U8*)scan, 0, do_utf8)) - cont = TRUE; - } - } - if (!cont) - break; + if (!REGINCLASS_utf8(p, (U8*)scan)) + break; scan += UTF8SKIP(scan); hardcount++; } |