Handle trailing whitespace in Shorewall::Config::read_a_line1()

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-04-14 10:14:25 -07:00
parent 1477d60926
commit 79b5c38ecb

View File

@ -2269,8 +2269,9 @@ sub read_a_line1() {
while ( $currentline = <$currentfile> ) { while ( $currentline = <$currentfile> ) {
next if $currentline =~ /^\s*#/; next if $currentline =~ /^\s*#/;
chomp $currentline; chomp $currentline;
next if $currentline =~ /^\s*$/;
$currentline =~ s/#.*$//; # Remove Trailing Comments $currentline =~ s/#.*$//; # Remove Trailing Comments
$currentline =~ s/\s*$//; # Remove Trailing Whitespace
next if $currentline =~ /^\s*$/;
fatal_error "Non-ASCII gunk in file" if $currentline =~ /[^\s[:print:]]/; fatal_error "Non-ASCII gunk in file" if $currentline =~ /[^\s[:print:]]/;
$currentlinenumber = $.; $currentlinenumber = $.;
print "IN===> $currentline\n" if $debug; print "IN===> $currentline\n" if $debug;