diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 92c3887d1..3e616c998 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -866,8 +866,10 @@ sub read_a_line() { # Continuation # chop $currentline, next if substr( ( $currentline .= $_ ), -1, 1 ) eq '\\'; - - $currentline =~ s/#.*$//; # Remove Trailing Comments -- result might be a blank line + # + # Remove Trailing Comments -- result might be a blank line + # + $currentline =~ s/#.*$//; # # Ignore ( concatenated ) Blank Lines # @@ -875,11 +877,11 @@ sub read_a_line() { # # Expand Shell Variables using %ENV # - while ( $currentline =~ m( ^(.*?) - \$({)? - ([a-zA-Z]\w*) - (?(2)}) - (.*)$)x + while ( $currentline =~ m( ^(.*?) #Part preceding '$' + \$({)? #'$' and optional '{' + ([a-zA-Z]\w*) #Shell Variable Name + (?(2)}) #Match closing '}' + (.*)$)x #Rest of Line ) { my $val = $ENV{$3}; $val = '' unless defined $val;