summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-04-14 15:39:03 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-04-14 15:39:03 +0000
commit4f3c32546b547af6262d8930a45dba1424528eeb (patch)
treebddfab1058bf96cc9d76de9ff6ae4356b3cdc24b
parentd05d91c1964a43c3e5c80a2681dcbf76eca16ca6 (diff)
downloadperl-MDK-Common-4f3c32546b547af6262d8930a45dba1424528eeb.tar
perl-MDK-Common-4f3c32546b547af6262d8930a45dba1424528eeb.tar.gz
perl-MDK-Common-4f3c32546b547af6262d8930a45dba1424528eeb.tar.bz2
perl-MDK-Common-4f3c32546b547af6262d8930a45dba1424528eeb.tar.xz
perl-MDK-Common-4f3c32546b547af6262d8930a45dba1424528eeb.zip
decode ' inside '' properly in getVarsFromSh
-rw-r--r--NEWS4
-rw-r--r--lib/MDK/Common.pm.pl2
-rw-r--r--lib/MDK/Common/System.pm7
3 files changed, 11 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 9d091ea..c180458 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Version 1.2.18 - 14 April 2009, by Pascal Terjan
+
+- decode ' inside '' properly in getVarsFromSh
+
Version 1.2.17 - 10 March 2009, by Pascal Terjan
- protect various chars in setExportedVarsInSh and setExportedVarsInCsh
diff --git a/lib/MDK/Common.pm.pl b/lib/MDK/Common.pm.pl
index 5f53635..51090c5 100644
--- a/lib/MDK/Common.pm.pl
+++ b/lib/MDK/Common.pm.pl
@@ -73,7 +73,7 @@ our @ISA = qw(Exporter);
# perl_checker: RE-EXPORT-ALL
our @EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::;
-our $VERSION = "1.2.17";
+our $VERSION = "1.2.18";
1;
EOF
diff --git a/lib/MDK/Common/System.pm b/lib/MDK/Common/System.pm
index 900f6aa..7ff4e4c 100644
--- a/lib/MDK/Common/System.pm
+++ b/lib/MDK/Common/System.pm
@@ -341,7 +341,12 @@ sub getVarsFromSh {
s/#.*//; # remove comments
s/^\s*//; # leading space
my ($v, $val) = /^(\w+)=(.*)/ or next;
- $val = $1 if $val =~ /^"(.*)"$/ || $val =~ /^'(.*)'$/;
+ if ($val =~ /^"(.*)"$/) {
+ $val = $1;
+ } elsif ($val =~ /^'(.*)'$/) {
+ $val = $1;
+ $val =~ s/(^|[^'])'\\''/$1'/g;
+ }
$l{$v} = $val;
}
%l;