summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regcomp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 65db009152..0d6b581b74 100644
--- 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: