This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: In EBCDIC [i-j] exclude also ASCII
authorKarl Williamson <public@khwilliamson.com>
Sat, 6 Apr 2013 18:56:52 +0000 (12:56 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 29 Aug 2013 15:56:06 +0000 (09:56 -0600)
i and j are not adjacent in EBCDIC.  This excluded any alphabetic
characters between them, but allowed other ascii ones.

regcomp.c
t/re/pat_advanced.t

index 595cabc..7f16ff2 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13191,6 +13191,8 @@ parseit:
                 && (prevvalue >= 'a' && value <= 'z')
                     || (prevvalue >= 'A' && value <= 'Z'))
             {
+                _invlist_intersection(this_range, PL_ASCII,
+                                      &this_range);
                 _invlist_intersection(this_range, PL_Posix_ptrs[_CC_ALPHA],
                                       &this_range);
             }
index 012bc4a..0c3d2d7 100644 (file)
@@ -89,6 +89,7 @@ sub run_tests {
         # should not match.
         ok "\x8e" =~ /[\x89-\x91]/, '"\x8e" =~ /[\x89-\x91]/';
         ok "\xce" =~ /[\xc9-\xd1]/, '"\xce" =~ /[\xc9-\xd1]/';
+        ok "\xd0" =~ /[\xc9-\xd1]/, '"\xd0" =~ /[\xc9-\xd1]/';
 
         skip "Not an EBCDIC platform", 2 unless ord ('i') == 0x89 &&
                                                 ord ('J') == 0xd1;
@@ -99,6 +100,7 @@ sub run_tests {
         # the good of EBCDIC, so let's test these only there.
         unlike("\x8e", qr/[i-j]/, '"\x8e" !~ /[i-j]/');
         unlike("\xce", qr/[I-J]/, '"\xce" !~ /[I-J]/');
+        unlike("\xd0", qr/[I-J]/, '"\xd0" !~ /[I-J]/');
     }
 
     {