From c10ea7befdebd4366179c7f79b33fcd6b622079e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 20 Jan 2011 07:27:14 -0800 Subject: [PATCH] Fix empty variable handling when /bin/sh is bash --- Shorewall/Perl/Shorewall/Config.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 6373472e9..5fff17aa8 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2952,7 +2952,7 @@ sub get_params() { if ( /^declare -x (.*?)="(.*[^\\])"$/ ) { $params{$1} = $2 unless $1 eq '_'; } elsif ( /^declare -x (.*?)="(.*)$/ ) { - $params{$variable=$1}="${2}\n"; + $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n"; } elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ ) { $params{$1} = ''; } else { @@ -2976,7 +2976,7 @@ sub get_params() { if ( /^export (.*?)="(.*[^\\])"$/ ) { $params{$1} = $2 unless $1 eq '_'; } elsif ( /^export (.*?)="(.*)$/ ) { - $params{$variable=$1}="${2}\n"; + $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n"; } elsif ( /^export (.*)\s+$/ || /^export (.*)=""$/ ) { $params{$1} = ''; } else {