From: Jarkko Hietaniemi Date: Sat, 23 Jun 2001 12:14:15 +0000 (+0000) Subject: Fix for ID 20010619.003, the [[:print:]] is not supposed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f79b30955198f840af4394fc38877ab5d06cc758;p=p5sagit%2Fp5-mst-13.2.git Fix for ID 20010619.003, the [[:print:]] is not supposed to match the whole isprint(), only the space character. p4raw-id: //depot/perl@10855 --- diff --git a/handy.h b/handy.h index c2bfe1e..9fd6de8 100644 --- 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)) diff --git a/pod/perlre.pod b/pod/perlre.pod index 5fd545f..61907f8 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -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 diff --git a/t/op/pat.t b/t/op/pat.t index 2531d71..e5d3145 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -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"; +