Improve readability (and add comments)

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6929 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-07-21 20:40:34 +00:00
parent c8cf4f6685
commit 438d3aec0b

View File

@ -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;