Only do SET and RESET when we aren't omitting.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-12-04 16:27:18 -08:00
parent c18996b6f5
commit 2fbbc70e83

View File

@ -2044,12 +2044,15 @@ sub process_conditional( $$$$ ) {
cond_error( q(Unexpected "?ENDIF" without matching ?IF or ?ELSE) , $filename, $linenumber ) if @ifstack <= $ifstack; cond_error( q(Unexpected "?ENDIF" without matching ?IF or ?ELSE) , $filename, $linenumber ) if @ifstack <= $ifstack;
$omitting = $prioromit; $omitting = $prioromit;
pop @ifstack; pop @ifstack;
} elsif ( $keyword =~ /^SET/ ) { } elsif ( ! $omitting ) {
if ( $keyword =~ /^SET/ ) {
fatal_error( "Missing SET variable", $filename, $linenumber ) unless supplied $expression; fatal_error( "Missing SET variable", $filename, $linenumber ) unless supplied $expression;
( my $var , $expression ) = split ' ', $expression, 2; ( my $var , $expression ) = split ' ', $expression, 2;
cond_error( "Invalid SET variable ($var)", $filename, $linenumber) unless $var =~ /^\$?([a-zA-Z]\w*)$/; cond_error( "Invalid SET variable ($var)", $filename, $linenumber) unless $var =~ /^\$?([a-zA-Z]\w*)$/;
cond_error( "Missing SET expression" , $filename, $linenumber) unless supplied $expression; cond_error( "Missing SET expression" , $filename, $linenumber) unless supplied $expression;
$variables{$1} = evaluate_expression( $expression, $filename, $linenumber ); $variables{$1} = evaluate_expression( $expression,
$filename,
$linenumber );
} else { } else {
my $var = $expression; my $var = $expression;
cond_error( "Missing RESET variable", $filename, $linenumber) unless supplied $var; cond_error( "Missing RESET variable", $filename, $linenumber) unless supplied $var;
@ -2061,6 +2064,7 @@ sub process_conditional( $$$$ ) {
cond_warning( "Variable $1 does not exist", $filename, $linenumber ); cond_warning( "Variable $1 does not exist", $filename, $linenumber );
} }
} }
}
$omitting; $omitting;
} }