Correct check for leading zeros in action variables.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-11-29 14:39:02 -08:00
parent 409c427134
commit 11d4e92a29

View File

@ -2483,7 +2483,7 @@ sub expand_variables( \$ ) {
my $val; my $val;
if ( $var =~ /^\d+$/ ) { if ( $var =~ /^\d+$/ ) {
fatal_error "Undefined parameter (\$$var)" if ( ! defined $actparms[$var] ) || ( length( $var ) > 0 && $var =~ /^0/ ); fatal_error "Undefined parameter (\$$var)" if ( ! defined $actparms[$var] ) || ( length( $var ) > 1 && $var =~ /^0/ );
$val = $var ? $actparms[$var] : $actparms[0]->{name}; $val = $var ? $actparms[$var] : $actparms[0]->{name};
} elsif ( exists $params{$var} ) { } elsif ( exists $params{$var} ) {
$val = $params{$var}; $val = $params{$var};