diff options
author | Karl Williamson <khw@cpan.org> | 2014-12-11 12:37:01 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-02-06 15:18:42 -0700 |
commit | 7b6c24ebb3691ddc8d373cbbb4181b9814f715e7 (patch) | |
tree | a8f877540587d0c647648897dfe72ab97eae0e2a /dist/Carp | |
parent | db1c86081ea5f36bc936ba37e7589e85b7fbe1ed (diff) | |
download | perl-7b6c24ebb3691ddc8d373cbbb4181b9814f715e7.tar.gz |
Carp: Fix off-by-one error for early Perl versions
This error occurred only when running Perl before 5.14, and included DEL
as a printable instead of excluding it.
Diffstat (limited to 'dist/Carp')
-rw-r--r-- | dist/Carp/lib/Carp.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm index 9c5e4b8aae..a03f7e0c9a 100644 --- a/dist/Carp/lib/Carp.pm +++ b/dist/Carp/lib/Carp.pm @@ -300,7 +300,7 @@ sub format_arg { } my $o = ord($c); substr $arg, $i, 1, sprintf("\\x{%x}", $o) - if $o < 0x20 || $o > 0x7f; + if $o < 0x20 || $o > 0x7e; } } else { $arg =~ s/([\"\\\$\@])/\\$1/g; @@ -318,7 +318,7 @@ sub Regexp::CARP_TRACE { my $o = ord(substr($arg, $i, 1)); my $x = substr($arg, 0, 0); # work around bug on Perl 5.8.{1,2} substr $arg, $i, 1, sprintf("\\x{%x}", $o) - if $o < 0x20 || $o > 0x7f; + if $o < 0x20 || $o > 0x7e; } } else { $arg =~ s/([^ -~])/sprintf("\\x{%x}",ord($1))/eg; |