Skip to content

Commit 0b172d1

Browse files
author
Rick Myers
committed
Fix over-escaping problem, per GitHub issue gnp#9
1 parent 6d1e623 commit 0b172d1

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

CHANGES.pod

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ A reverse-chronological ordered list of changes
3535

3636
Removed POSIX::tempnam() deprecation warning.
3737

38+
=item *
39+
40+
Fixed over-escaping problem. "\\\\" now evaluates as "\\" instead of "\".
41+
3842
=back
3943

4044

lib/Psh/Parser.pm

+13-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,19 @@ sub remove_backslash {
264264
$text=~ s/\\e/\e/g;
265265
$text=~ s/\\(0[0-7][0-7])/chr(oct($1))/ge;
266266
$text=~ s/\\(x[0-9a-fA-F][0-9a-fA-F])/chr(oct($1))/ge;
267-
$text=~ s/\\(.)/$1/g;
267+
#
268+
#$text=~ s/\\(.)/$1/g;
269+
#
270+
# this breaks constructs like:
271+
# > print "\\\\\n"
272+
# \
273+
# >
274+
# should be:
275+
# > print "\\\\\n"
276+
# \\
277+
# >
278+
#
279+
268280
return $text;
269281
}
270282

0 commit comments

Comments
 (0)