New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perl debugger outputs ctrl-\ wrongly #3824
Comments
From newton@ficus.frogspace.netThe Perl debugger outputs strings containing the character (Pesky character, that.) Perl Info
|
From @schwern
The problem is in dumpvar.pl which x uses. The attached patch fixes this. |
From @schwerndv.patch--- lib/dumpvar.pl 2005/07/12 22:27:33 1.1
+++ lib/dumpvar.pl 2005/07/12 22:34:03
@@ -80,13 +80,21 @@
} elsif ($unctrl eq 'quote') {
s/([\"\\\$\@])/\\$1/g if $tick eq '"';
s/\033/\\e/g;
- s/([\000-\037\177])/'\\c'.chr(ord($1)^64)/eg;
+ s/([\000-\037\177])/'\\c'._escaped_ord($1)/eg;
}
$_ = uniescape($_);
s/([\200-\377])/'\\'.sprintf('%3o',ord($1))/eg if $quoteHighBit;
($noticks || /^\d+(\.\d*)?\Z/)
? $_
: $tick . $_ . $tick;
+}
+
+# Ensure a resulting \ is escaped to be \\
+sub _escaped_ord {
+ my $chr = shift;
+ $chr = chr(ord($chr)^64);
+ $chr =~ s{\\}{\\\\}g;
+ return $chr;
}
sub ShortArray {
|
From @TuxOn Tue, 12 Jul 2005 15:36:54 -0700, "Michael G Schwern via RT"
Thanks, applied as change #25130 -- |
@schwern - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#6749 (status was 'resolved')
Searchable as RT6749$
The text was updated successfully, but these errors were encountered: