1
0
mirror of https://gitlab.com/shorewall/code.git synced 2024-12-21 05:41:07 +01:00

Correct ?SET error message

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-12-21 15:23:26 -08:00
parent a5debe793f
commit 0eb041d2d1

View File

@ -485,6 +485,7 @@ my $embedded; # True if we're in an embedded perl script
my @tempfiles; # Files that need unlinking at END my @tempfiles; # Files that need unlinking at END
my $first_entry; # Message to output or function to call on first non-blank line of a file my $first_entry; # Message to output or function to call on first non-blank line of a file
our $file_format; # Format of configuration file. our $file_format; # Format of configuration file.
my $max_format # Max format value
my $shorewall_dir; # Shorewall Directory; if non-empty, search here first for files. my $shorewall_dir; # Shorewall Directory; if non-empty, search here first for files.
@ -897,6 +898,7 @@ sub initialize( $;$$) {
$currentfilename = ''; # File NAME $currentfilename = ''; # File NAME
$currentlinenumber = 0; # Line number $currentlinenumber = 0; # Line number
$first_entry = 0; # Message to output or function to call on first non-blank file entry $first_entry = 0; # Message to output or function to call on first non-blank file entry
$max_format = 1;
$shorewall_dir = ''; #Shorewall Directory $shorewall_dir = ''; #Shorewall Directory
@ -1944,7 +1946,7 @@ sub pop_include() {
} }
if ( $arrayref ) { if ( $arrayref ) {
( $currentfile, $currentfilename, $currentlinenumber, $ifstack, $file_format ) = @$arrayref; ( $currentfile, $currentfilename, $currentlinenumber, $ifstack, $file_format, $max_format ) = @$arrayref;
} else { } else {
$currentfile = undef; $currentfile = undef;
$currentlinenumber = 'EOF'; $currentlinenumber = 'EOF';
@ -2135,7 +2137,7 @@ sub process_compiler_directive( $$$$ ) {
pop @ifstack; pop @ifstack;
} elsif ( ! $omitting ) { } elsif ( ! $omitting ) {
if ( $keyword =~ /^SET/ ) { if ( $keyword =~ /^SET/ ) {
fatal_error( "Missing SET variable", $filename, $linenumber ) unless supplied $expression; directive_error( "Missing SET variable", $filename, $linenumber ) unless supplied $expression;
( my $var , $expression ) = split ' ', $expression, 2; ( my $var , $expression ) = split ' ', $expression, 2;
directive_error( "Invalid SET variable ($var)", $filename, $linenumber) unless $var =~ /^\$?([a-zA-Z]\w*)$/; directive_error( "Invalid SET variable ($var)", $filename, $linenumber) unless $var =~ /^\$?([a-zA-Z]\w*)$/;
directive_error( "Missing SET expression" , $filename, $linenumber) unless supplied $expression; directive_error( "Missing SET expression" , $filename, $linenumber) unless supplied $expression;
@ -2426,7 +2428,7 @@ EOF
# #
sub push_open( $ ) { sub push_open( $ ) {
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack, $file_format ] if $currentfile; push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack, $file_format, $max_format ] if $currentfile;
my @a = @includestack; my @a = @includestack;
push @openstack, \@a; push @openstack, \@a;
@includestack = (); @includestack = ();