summaryrefslogtreecommitdiff
path: root/dist/Carp
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-12-11 12:37:01 -0700
committerKarl Williamson <khw@cpan.org>2015-02-06 15:18:42 -0700
commit7b6c24ebb3691ddc8d373cbbb4181b9814f715e7 (patch)
treea8f877540587d0c647648897dfe72ab97eae0e2a /dist/Carp
parentdb1c86081ea5f36bc936ba37e7589e85b7fbe1ed (diff)
downloadperl-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.pm4
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;