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 --- NEWS | 4 ++++ lib/MDK/Common.pm.pl | 2 +- lib/MDK/Common/System.pm | 7 ++++++- 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; -- cgit v1.2.1