From 164d2f5d1b1962801025e7d0062724b7a5670e43 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 17 Mar 2012 10:26:36 -0700 Subject: [PATCH] Some corrections to conditional inclusion Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index d8b4b38b8..e521e91a5 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1574,6 +1574,8 @@ sub copy( $ ) { my $file = $_[0]; my $save_ifstack = $ifstack; + $ifstack = @ifstack; + open IF , $file or fatal_error "Unable to open $file: $!"; while ( ) { @@ -1601,7 +1603,7 @@ sub copy( $ ) { } } - unless( $save_ifstack == @ifstack ) { + unless( $ifstack == @ifstack ) { my $lastref = $ifstack[-1]; $currentlinenumber = 'EOF'; $currentfilename = $file; @@ -1625,6 +1627,9 @@ sub copy1( $ ) { if ( $script || $debug ) { my ( $do_indent, $here_documents ) = ( 1, ''); my $save_ifstack = $ifstack; + + $ifstack = @ifstack; + open_file( $_[0] ); while ( $currentfile ) { @@ -1722,7 +1727,7 @@ sub copy1( $ ) { } } - unless( $save_ifstack == @ifstack ) { + unless( $ifstack == @ifstack ) { my $lastref = $ifstack[-1]; $currentlinenumber = 'EOF'; $currentfilename = $_[0]; @@ -1761,6 +1766,8 @@ sub copy2( $$ ) { unless ( $empty ) { my $save_ifstack = $ifstack; + $ifstack = @ifstack; + emit <