summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;