Skip Menu |

This queue is for tickets about the Devel-GDB CPAN distribution.

Report information
The Basics
Id: 32436
Status: resolved
Priority: 0/
Queue: Devel-GDB

People
Owner: Nobody in particular
Requestors: varia [...] depeuter.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.0
Fixed in: (no value)



Subject: Error in unescape function
The current _unescape function doesn't work correctly. For example, test with "\\r" as input. This should return "\r" as output because this is just an escaped backslash followed by an "r". However in current code, \r is evaluated first and therefore this unescaping will fail ... A fixed version below. Cheers, -- Geert my %unesc = ( "\\" => "\\", "\"" => "\"", "a" => "\a", "b" => "\b", "t" => "\t", "n" => "\n", "f" => "\f", "r" => "\r", "e" => "\e", "v" => "\013", ); sub _unescape { # Looks like we have to do this one ourselves my ($string) = @_; # Unescape any \X for various characters X (including \\ and \") # NOTE : Shouldn't "v" be added to the list below ? $string =~ s/\\([\\\"abtnfre])/$unesc{$1}/esg; # Unescape \OCTAL for various octal values $string =~ s/\\(0[0-7]+)/chr(oct($1))/esg; return $string; }
Subject: Re: [rt.cpan.org #32436] Error in unescape function
Date: Sat, 19 Jan 2008 20:33:12 -0500
To: bug-Devel-GDB [...] rt.cpan.org
From: "Josef Ezra" <jezra [...] cpan.org>
Thank you Geert You are right, of course. I'll implement your change during the next week. Best, Josef On Jan 18, 2008 8:52 PM, Geert De Peuter via RT <bug-Devel-GDB@rt.cpan.org> wrote: Show quoted text
> > Fri Jan 18 20:52:11 2008: Request 32436 was acted upon. > Transaction: Ticket created by Geert > Queue: Devel-GDB > Subject: Error in unescape function > Broken in: 2.0 > Severity: Normal > Owner: Nobody > Requestors: varia@depeuter.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=32436 > > > > The current _unescape function doesn't work correctly. > For example, test with "\\r" as input. This should return "\r" as > output because this is just an escaped backslash followed by an "r". > However in current code, \r is evaluated first and therefore this > unescaping will fail ... > > A fixed version below. > > Cheers, > -- Geert > > my %unesc = > ( > "\\" => "\\", > "\"" => "\"", > "a" => "\a", > "b" => "\b", > "t" => "\t", > "n" => "\n", > "f" => "\f", > "r" => "\r", > "e" => "\e", > "v" => "\013", > ); > > sub _unescape > { > # Looks like we have to do this one ourselves > my ($string) = @_; > > # Unescape any \X for various characters X (including \\ and \") > # NOTE : Shouldn't "v" be added to the list below ? > $string =~ s/\\([\\\"abtnfre])/$unesc{$1}/esg; > > # Unescape \OCTAL for various octal values > $string =~ s/\\(0[0-7]+)/chr(oct($1))/esg; > > return $string; > } > >
From: jezra [...] cpan.org
The bug fix was implemented in version 2.01. thank you.
see Changes in Devel::GDB version 2.01