Fix for ID 20010619.003, the [[:print:]] is not supposed
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 23 Jun 2001 12:14:15 +0000 (12:14 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 23 Jun 2001 12:14:15 +0000 (12:14 +0000)
to match the whole isprint(), only the space character.

p4raw-id: //depot/perl@10855

handy.h
pod/perlre.pod
t/op/pat.t

diff --git a/handy.h b/handy.h
index c2bfe1e..9fd6de8 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -343,7 +343,7 @@ Converts the specified character to lowercase.
 #   define isASCII(c)  ((c) <= 127)
 #   define isCNTRL(c)  ((c) < ' ')
 #   define isGRAPH(c)  (isALNUM(c) || isPUNCT(c))
-#   define isPRINT(c)  (((c) > 32 && (c) < 127) || isSPACE(c))
+#   define isPRINT(c)  (((c) > 32 && (c) < 127) || (c) == ' ')
 #   define isPUNCT(c)  (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64)  || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
 #   define isXDIGIT(c)  (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
 #   define toUPPER(c)  (isLOWER(c) ? (c) - ('a' - 'A') : (c))
index 5fd545f..61907f8 100644 (file)
@@ -268,7 +268,7 @@ Any alphanumeric or punctuation (special) character.
 
 =item print
 
-Any alphanumeric or punctuation (special) character or space.
+Any alphanumeric or punctuation (special) character or the space character.
 
 =item punct
 
index 2531d71..e5d3145 100755 (executable)
@@ -6,7 +6,7 @@
 
 $| = 1;
 
-print "1..634\n";
+print "1..639\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -1796,3 +1796,22 @@ if(test_o('abc','..(.)') eq 'a') {
     print "not ok 634\n";
 }
 
+# 635..639: ID 20010619.003 (only the space character is
+# supposed to be [:print:], not the whole isprint()).
+
+print "not " if "\n"     =~ /[[:print:]]/;
+print "ok 635\n";
+
+print "not " if "\t"     =~ /[[:print:]]/;
+print "ok 636\n";
+
+# Amazingly verrical tabulator is the same in ASCII and EBCDIC.
+print "not " if "\014"  =~ /[[:print:]]/;
+print "ok 637\n";
+
+print "not " if "\r"    =~ /[[:print:]]/;
+print "ok 638\n";
+
+print "not " unless " " =~ /[[:print:]]/;
+print "ok 639\n";
+