forked from extern/shorewall_code
Avoid funny-looking ERROR: messages out of Embedded Perl.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
885830b67c
commit
85f58d6906
@ -391,6 +391,7 @@ our $currentfilename; # File NAME
|
|||||||
my $currentlinenumber; # Line number
|
my $currentlinenumber; # Line number
|
||||||
my $perlscript; # File Handle Reference to current temporary file being written by an in-line Perl script
|
my $perlscript; # File Handle Reference to current temporary file being written by an in-line Perl script
|
||||||
my $perlscriptname; # Name of that file.
|
my $perlscriptname; # Name of that file.
|
||||||
|
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
|
||||||
|
|
||||||
@ -501,7 +502,7 @@ sub initialize( $;$ ) {
|
|||||||
$omitting = 0;
|
$omitting = 0;
|
||||||
$ifstack = 0;
|
$ifstack = 0;
|
||||||
@ifstack = ();
|
@ifstack = ();
|
||||||
|
$embedded = 0;
|
||||||
#
|
#
|
||||||
# Misc Globals
|
# Misc Globals
|
||||||
#
|
#
|
||||||
@ -949,8 +950,13 @@ sub fatal_error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup;
|
cleanup;
|
||||||
confess " ERROR: @_$currentlineinfo" if $confess;
|
if ( $embedded ) {
|
||||||
die " ERROR: @_$currentlineinfo\n";
|
confess "@_$currentlineinfo" if $confess;
|
||||||
|
die "@_$currentlineinfo\n";
|
||||||
|
} else {
|
||||||
|
confess " ERROR: @_$currentlineinfo" if $confess;
|
||||||
|
die " ERROR: @_$currentlineinfo\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub fatal_error1 {
|
sub fatal_error1 {
|
||||||
@ -2085,6 +2091,8 @@ sub embedded_perl( $ ) {
|
|||||||
fatal_error ( "Invalid END PERL directive" ) unless $currentline =~ /^\s*$/;
|
fatal_error ( "Invalid END PERL directive" ) unless $currentline =~ /^\s*$/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$embedded++;
|
||||||
|
|
||||||
unless (my $return = eval $command ) {
|
unless (my $return = eval $command ) {
|
||||||
#
|
#
|
||||||
# Perl found the script offensive or the script itself died
|
# Perl found the script offensive or the script itself died
|
||||||
@ -2102,6 +2110,8 @@ sub embedded_perl( $ ) {
|
|||||||
fatal_error "Perl Script Returned False";
|
fatal_error "Perl Script Returned False";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$embedded--;
|
||||||
|
|
||||||
if ( $perlscript ) {
|
if ( $perlscript ) {
|
||||||
fatal_error "INCLUDEs nested too deeply" if @includestack >= 4;
|
fatal_error "INCLUDEs nested too deeply" if @includestack >= 4;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user