This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix deparsing of transliterations with unprintable characters.
authorJohn Lightsey <lightsey@debian.org>
Tue, 31 Oct 2017 23:12:26 +0000 (18:12 -0500)
committerNicolas R <atoomic@cpan.org>
Mon, 6 Nov 2017 16:39:43 +0000 (10:39 -0600)
RT #132405

Signed-off-by: Nicolas R <atoomic@cpan.org>
lib/B/Deparse.pm
lib/B/Deparse.t

index 35d305f..7609d63 100644 (file)
@@ -5632,7 +5632,7 @@ sub pchr { # ASCII
     } elsif ($n == ord "\r") {
        return '\\r';
     } elsif ($n >= ord("\cA") and $n <= ord("\cZ")) {
-       return '\\c' . unctrl{chr $n};
+       return '\\c' . $unctrl{chr $n};
     } else {
 #      return '\x' . sprintf("%02x", $n);
        return '\\' . sprintf("%03o", $n);
index b75a162..d94d7f6 100644 (file)
@@ -2851,3 +2851,8 @@ $x = `$a-$b`;
 # multiconcat within qr//
 my($r, $a, $b);
 $r = qr/abc\Q$a-$b\Exyz/;
+####
+# tr with unprintable characters
+my $str;
+$str = 'foo';
+$str =~ tr/\cA//;