This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Emphasize that only [A-Za-z] is used here
authorKarl Williamson <public@khwilliamson.com>
Wed, 20 Feb 2013 15:22:07 +0000 (08:22 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 29 Aug 2013 15:55:53 +0000 (09:55 -0600)
This code is attempting to deal with the problem of holes in the ranges
a-z and A-Z in EBCDIC.  By using macros with the suffix "_A", we
emphasize that.

toke.c

diff --git a/toke.c b/toke.c
index 2a9e23b..45e3fd9 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3158,15 +3158,15 @@ S_scan_const(pTHX_ char *start)
 
 #ifdef EBCDIC
                if (literal_endpoint == 2 &&
-                   ((isLOWER(min) && isLOWER(max)) ||
-                    (isUPPER(min) && isUPPER(max)))) {
-                   if (isLOWER(min)) {
+                   ((isLOWER_A(min) && isLOWER_A(max)) ||
+                    (isUPPER_A(min) && isUPPER_A(max)))) {
+                   if (isLOWER_A(min)) {
                        for (i = min; i <= max; i++)
-                           if (isLOWER(i))
+                           if (isLOWER_A(i))
                                *d++ = NATIVE_TO_NEED(has_utf8,i);
                    } else {
                        for (i = min; i <= max; i++)
-                           if (isUPPER(i))
+                           if (isUPPER_A(i))
                                *d++ = NATIVE_TO_NEED(has_utf8,i);
                    }
                }