In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/295c2f7d5349d9417307a84d22b5ba63d9a655ed?hp=72d70e5644e8e9254a0e459933aaaec0b6fa01b3>
- Log ----------------------------------------------------------------- commit 295c2f7d5349d9417307a84d22b5ba63d9a655ed Author: Karl Williamson <[email protected]> Date: Mon Mar 14 09:18:28 2011 -0600 regcomp.c: utf8 pattern implies uni rules This fixes a regression introduced with charset regex modifiers. A utf8 pattern without a charset is supposed to mean unicode semantics. But it didn't until this patch. ----------------------------------------------------------------------- Summary of changes: regcomp.c | 4 +++- t/re/pat_advanced.t | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/regcomp.c b/regcomp.c index 3f4d634..e7ec7e0 100644 --- a/regcomp.c +++ b/regcomp.c @@ -6996,7 +6996,9 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) U32 posflags = 0, negflags = 0; U32 *flagsp = &posflags; bool has_charset_modifier = 0; - regex_charset cs = REGEX_DEPENDS_CHARSET; + regex_charset cs = (RExC_utf8 || RExC_uni_semantics) + ? REGEX_UNICODE_CHARSET + : REGEX_DEPENDS_CHARSET; while (*RExC_parse) { /* && strchr("iogcmsx", *RExC_parse) */ diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t index f9b91fb..225cb19 100644 --- a/t/re/pat_advanced.t +++ b/t/re/pat_advanced.t @@ -2071,6 +2071,12 @@ EOP # RT #82610 ok 'foo/file.fob' =~ m,^(?=[^\.])[^/]*/(?=[^\.])[^/]*\.fo[^/]$,; + { # This was failing unless an explicit /d was added + my $p = qr/[\xE0_]/i; + utf8::upgrade($p); + like("\xC0", $p, "Verify \"\\xC0\" =~ /[\\xE0_]/i; pattern in utf8"); + } + # # Keep the following tests last -- they may crash perl # -- Perl5 Master Repository
