In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/8cc86590c5aa026ef05d88e777ab02f3434e8415?hp=76a2b88f6f42d780c1d7625b9d510847a6aff624>

- Log -----------------------------------------------------------------
commit 8cc86590c5aa026ef05d88e777ab02f3434e8415
Author: Karl Williamson <[email protected]>
Date:   Wed Oct 20 13:21:04 2010 -0600

    regcomp.c: /d not overriding /u
    
    The setting of the charset regex modifiers was wrong.  /d didn't
    override /u nor /l, and similarly /u and /l didn't properly override
    each other.

M       regcomp.c
M       t/re/pat.t

commit f6e17a8494f84e70891cf58d8de1f22dbeac544c
Author: Karl Williamson <[email protected]>
Date:   Sun Oct 17 10:38:37 2010 -0600

    regcomp.c: Fix typo in comment

M       regcomp.c
-----------------------------------------------------------------------

Summary of changes:
 regcomp.c  |   12 ++++++------
 t/re/pat.t |   11 ++++++++++-
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/regcomp.c b/regcomp.c
index e0f65fa..831d579 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -6238,16 +6238,16 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 
*flagp,U32 depth)
                         if (has_charset_modifier || flagsp == &negflags) {
                             goto fail_modifiers;
                         }
-                        *flagsp &= ~RXf_PMf_UNICODE;
-                        *flagsp |= RXf_PMf_LOCALE;
+                        posflags |= RXf_PMf_LOCALE;
+                        negflags |= RXf_PMf_UNICODE;
                         has_charset_modifier = 1;
                         break;
                     case UNICODE_PAT_MOD:
                         if (has_charset_modifier || flagsp == &negflags) {
                             goto fail_modifiers;
                         }
-                        *flagsp &= ~RXf_PMf_LOCALE;
-                        *flagsp |= RXf_PMf_UNICODE;
+                        posflags |= RXf_PMf_UNICODE;
+                        negflags |= RXf_PMf_LOCALE;
                         has_charset_modifier = 1;
                         break;
                     case DUAL_PAT_MOD:
@@ -6257,7 +6257,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 
*flagp,U32 depth)
                         {
                             goto fail_modifiers;
                         }
-                        *flagsp &= ~(RXf_PMf_LOCALE|RXf_PMf_UNICODE);
+                        negflags |= (RXf_PMf_LOCALE|RXf_PMf_UNICODE);
                         has_charset_modifier = 1;
                         break;
                     case ONCE_PAT_MOD: /* 'o' */
@@ -8819,7 +8819,7 @@ S_reg_skipcomment(pTHX_ RExC_state_t *pRExC_state)
 
 /* nextchar()
 
-   Advance that parse position, and optionall absorbs
+   Advance that parse position, and optionally absorbs
    "whitespace" from the inputstream.
 
    Without /x "whitespace" means (?#...) style comments only,
diff --git a/t/re/pat.t b/t/re/pat.t
index bb60999..1bbb73a 100644
--- a/t/re/pat.t
+++ b/t/re/pat.t
@@ -23,7 +23,7 @@ BEGIN {
 }
 
 
-plan tests => 406;  # Update this when adding/deleting tests.
+plan tests => 408;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
@@ -1088,6 +1088,15 @@ sub run_tests {
         ok $c =~ /$utf8_pattern/i, "\\xc0 =~ /$pattern/i; Both target and 
pattern utf8";
     }
 
+    SKIP: {   # Make sure can override the formatting
+        if ($IS_EBCDIC) {
+            skip "Needs to be customized to run on EBCDIC", 2;
+        }
+        use feature 'unicode_strings';
+        ok "\xc0" =~ /\w/, 'Under unicode_strings: "\xc0" =~ /\w/';
+        ok "\xc0" !~ /(?d:\w)/, 'Under unicode_strings: "\xc0" !~ /(?d:\w)/';
+    }
+
     {
         # Test that a regex followed by an operator and/or a statement 
modifier work
         # These tests use string-eval so that it reports a clean error when it 
fails

--
Perl5 Master Repository

Reply via email to