From 4f3c32546b547af6262d8930a45dba1424528eeb Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 14 Apr 2009 15:39:03 +0000 Subject: decode ' inside '' properly in getVarsFromSh --- lib/MDK/Common/System.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/MDK/Common') 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; -- cgit v1.2.1