diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 5368cbbd7..874c67aa2 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -875,10 +875,10 @@ sub read_a_line() { # # Expand Shell Variables using %ENV # - while ( $currentline =~ /^(.*?)\$([a-zA-Z]\w*)(.*)$/ || $currentline =~ /^(.*?)\${([a-zA-Z]\w*)}(.*)$/ ) { - my $val = $ENV{$2}; + while ( $currentline =~ /^(.*?)\$({)?([a-zA-Z]\w*)(?(2)}|)(.*)$/ ) { + my $val = $ENV{$3}; $val = '' unless defined $val; - $currentline = join( '', $1 , $val , $3 ); + $currentline = join( '', $1 , $val , $4 ); } if ( $currentline =~ /^\s*INCLUDE\s/ ) {