summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRobin Houston <robin@cpan.org>2001-04-26 18:13:41 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-26 18:03:33 +0000
commit4682a7acab84a46ed9d265e274b72494a4818695 (patch)
tree3d9410bbb359e505dc1e392ab73d0a75ea123608 /ext
parente31885a02eaa46b40ba53b93494e3f27e6136eb0 (diff)
downloadperl-4682a7acab84a46ed9d265e274b72494a4818695.tar.gz
[PATCH B::Deparse] fix string uninterpretation
Date: Thu, 26 Apr 2001 17:13:41 +0100 Message-ID: <20010426171341.A27299@puffinry.freeserve.co.uk> Subject: Re: [PATCH B::Deparse] fix string uninterpretation From: Robin Houston <robin@kitsite.com> Date: Thu, 26 Apr 2001 18:44:29 +0100 Message-ID: <20010426184429.A27734@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9856
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B/Deparse.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index a96e3c2b1f..7f6a321710 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -2754,15 +2754,15 @@ sub pp_enterwrite { unop(@_, "write") }
# but not character escapes
sub uninterp {
my($str) = @_;
- $str =~ s/(^|[^\\])([\$\@]|\\[uUlLQE])/$1\\$2/g;
+ $str =~ s/(^|\G|[^\\])((?:\\\\)*)([\$\%\@]|\\[uUlLQE])/$1$2\\$3/g;
return $str;
}
-# the same, but treat $|, $), and $ at the end of the string differently
+# the same, but treat $|, $), $( and $ at the end of the string differently
sub re_uninterp {
my($str) = @_;
- $str =~ s/(^|[^\\])(\@|\\[uUlLQE])/$1\\$2/g;
- $str =~ s/(^|[^\\])(\$[^)|])/$1\\$2/g;
+ $str =~ s/(^|\G|[^\\])((?:\\\\)*)([\$\%\@](?!\||\)|\$\(|$)|\\[uUlLQE])/$1$2\\$3/g
+;
return $str;
}