PATCH: [perl #87908] \W is its complement sometimes
authorKarl Williamson <public@khwilliamson.com>
Wed, 6 Apr 2011 13:49:51 +0000 (07:49 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 6 Apr 2011 14:25:52 +0000 (08:25 -0600)
A missing '!' turned \W into \w in some code execution paths and utf8 data.
This patch fixes that.

It does not include tests at the moment, since I don't have time
just now to examine why the existing tests didn't catch this, when
it looks like they are set up to, and there have been several BBC tickets
lately that I'm hopeful this may fix and head off other ones.

regexec.c

index a6de6a8..391fc16 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1594,7 +1594,7 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
        case NALNUMU:
            REXEC_FBC_CSCAN_PRELOAD(
                LOAD_UTF8_CHARCLASS_ALNUM(),
-               swash_fetch(PL_utf8_alnum,(U8*)s, utf8_target),
+               !swash_fetch(PL_utf8_alnum,(U8*)s, utf8_target),
                 ! isWORDCHAR_L1((U8) *s)
            );
            break;