From: Jarkko Hietaniemi Date: Tue, 5 Dec 2000 16:30:21 +0000 (+0000) Subject: Fix a manual edit typo from #7993, fix the message formatting X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbb63a9e8bf07b6f1dccaccb6b70a9ad58efc968;p=p5sagit%2Fp5-mst-13.2.git Fix a manual edit typo from #7993, fix the message formatting for Unicode, add few our declarations. p4raw-id: //depot/perl@7994 --- diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm index d7b8990..36bdcd4 100644 --- a/lib/Carp/Heavy.pm +++ b/lib/Carp/Heavy.pm @@ -1,5 +1,8 @@ package Carp; +our $MaxEvalLen; +our $MaxLenArg; +our $Verbose; sub caller_info { my $i = shift(@_) + 1; @@ -46,8 +49,7 @@ sub format_arg { # The following handling of "control chars" is direct from # the original code - I think it is broken on Unicode though. # Suggestions? - $arg =~ s/([\200-\377])/sprintf("M-%c",ord($1)&0177)/eg; - $arg =~ s/([\0-\37\177])/sprintf("^%c",ord($1)^64)/eg; + $arg =~ s/([[:cntrl:]]|[[^:ascii:]])/sprintf("\\x{%x}",ord($1))/eg; return $arg; } @@ -137,6 +139,7 @@ sub ret_backtrace { while (my %i = caller_info(++$i)) { $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; + } return $mess || $err; }