Fix number of columns detection

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8339 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2008-03-22 17:35:46 +00:00
parent f6e8444992
commit bd5f8195e9

View File

@ -905,8 +905,13 @@ sub split_line( $$$ ) {
my @line = split( ' ', $currentline );
fatal_error "Invalid $description entry (too few columns)" if @line < $mincolumns;
fatal_error "Invalid $description entry (too many columns)" if @line > $maxcolumns;
my $line = @line;
fatal_error "Invalid $description entry (too many columns)" if $line > $maxcolumns;
1 while --$line >= 0 && $line[$line] eq '-';
fatal_error "Invalid $description entry (too few columns)" if $line < $mincolumns;
push @line, '-' while @line < $maxcolumns;
@ -928,8 +933,13 @@ sub split_line1( $$$ ) {
fatal_error "Shorewall Configuration file entries may not contain single quotes" if $currentline =~ /'/;
fatal_error "Non-ASCII gunk in file" if $currentline =~ /[^\s[:print:]]/;
fatal_error "Invalid $description entry (too few columns)" if @line < $mincolumns;
fatal_error "Invalid $description entry (too many columns)" if @line > $maxcolumns;
my $line = @line;
fatal_error "Invalid $description entry (too many columns)" if $line > $maxcolumns;
1 while --$line >= 0 && $line[$line] eq '-';
fatal_error "Invalid $description entry (too few columns)" if $line < $mincolumns;
push @line, '-' while @line < $maxcolumns;
@ -966,8 +976,13 @@ sub split_line2( $$$ ) {
fatal_error "Shorewall Configuration file entries may not contain single quotes" if $currentline =~ /'/;
fatal_error "Invalid $description entry (too few columns)" if @line < $mincolumns;
fatal_error "Invalid $description entry (too many columns)" if @line > $maxcolumns;
my $line = @line;
fatal_error "Invalid $description entry (too many columns)" if $line > $maxcolumns;
1 while --$line >= 0 && $line[$line] eq '-';
fatal_error "Invalid $description entry (too few columns)" if $line < $mincolumns;
push @line, '-' while @line < $maxcolumns;