summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-01-31 11:20:59 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2003-01-31 08:24:53 +0000
commit5dec093fd414e8adffdf65a1d75b0b0d7a2938c3 (patch)
tree62e0e9629bdf5c180e0dc088327c7db4546a42cf /regexec.c
parent68c03c1a4a512137101420548514238e4d2d85e5 (diff)
downloadperl-5dec093fd414e8adffdf65a1d75b0b0d7a2938c3.tar.gz
[FIX] Re: UTF-8 failures (surprise!)
Message-ID: <20030131072059.GB6045@ratsnest.hole> p4raw-id: //depot/perl@18608
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/regexec.c b/regexec.c
index a6fd6aee7e..ee53a47f3a 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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++;
}