implement /[:ascii:]/ on ebcdic machines
Peter Prymmer [Thu, 25 Nov 1999 21:06:19 +0000 (13:06 -0800)]
Message-Id: <199911260506.VAA17230@brio.forte.com>

p4raw-id: //depot/perl@4626

regcomp.c

index 65db009..0d6b581 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -2491,16 +2491,28 @@ S_regclass(pTHX)
                    if (LOC)
                        ANYOF_CLASS_SET(ret, ANYOF_ASCII);
                    else {
+#ifdef ASCIIish
                        for (value = 0; value < 128; value++)
                            ANYOF_BITMAP_SET(ret, value);
+#else  /* EBCDIC */
+                       for (value = 0; value < 256; value++)
+                           if (isASCII(value))
+                               ANYOF_BITMAP_SET(ret, value);
+#endif /* EBCDIC */
                    }
                    break;
                case ANYOF_NASCII:
                    if (LOC)
                        ANYOF_CLASS_SET(ret, ANYOF_NASCII);
                    else {
+#ifdef ASCIIish
                        for (value = 128; value < 256; value++)
                            ANYOF_BITMAP_SET(ret, value);
+#else  /* EBCDIC */
+                       for (value = 0; value < 256; value++)
+                           if (!isASCII(value))
+                               ANYOF_BITMAP_SET(ret, value);
+#endif /* EBCDIC */
                    }
                    break;
                case ANYOF_CNTRL: