From 239560be8d93f6259a8560de7c4d9a5ae102d13e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 28 Oct 2015 13:47:40 -0700 Subject: [PATCH] Add Cygwin-specific code in get_params() Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index f2c3db25f..32a2610bf 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -5147,6 +5147,7 @@ sub unsupported_yes_no_warning( $ ) { # sub get_params( $ ) { my $export = $_[0]; + my $cygwin = ( $shorewallrc{HOST} eq 'cygwin' ); my $fn = find_file 'params'; @@ -5189,7 +5190,9 @@ sub get_params( $ ) { for ( @params ) { chomp; - if ( /^declare -x (.*?)="(.*[^\\])"$/ ) { + if ( $cygwin && /^declare -x (.*?)="(.*)"$/ ) { + $params{$1} = $2 unless $1 eq '_'; + } elsif ( /^declare -x (.*?)="(.*[^\\])"$/ ) { $params{$1} = $2 unless $1 eq '_'; } elsif ( /^declare -x (.*?)="(.*)$/ ) { $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n"; @@ -5217,7 +5220,9 @@ sub get_params( $ ) { for ( @params ) { chomp; - if ( /^export (.*?)="(.*[^\\])"$/ ) { + if ( $cygwin && /^export (.*?)="(.*)"$/ ) { + $params{$1} = $2 unless $1 eq '_'; + } elsif ( /^export (.*?)="(.*[^\\])"$/ ) { $params{$1} = $2 unless $1 eq '_'; } elsif ( /^export (.*?)="(.*)$/ ) { $params{$variable=$1} = $2 eq '"' ? '' : "${2}\n";