summaryrefslogtreecommitdiffstats
path: root/lib/MDK/Common/System.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MDK/Common/System.pm')
-rw-r--r--lib/MDK/Common/System.pm7
1 files changed, 6 insertions, 1 deletions
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;