From d4a1e7dba932fa7550b73e92462648a2ced6eb79 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 19 Mar 2012 07:23:24 -0700 Subject: [PATCH] Revert "Allow ?IF, ?ELSE and ?ENDIF in copied files" This reverts commit 29dd342118cbdb17e76dcb4659f3abb3d996df9e. --- Shorewall/Perl/Shorewall/Config.pm | 46 +----------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 88344b471..f15eb7c67 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1601,15 +1601,6 @@ sub copy( $ ) { } } - unless( $save_ifstack == @ifstack ) { - my $lastref = $ifstack[-1]; - $currentlinenumber = 'EOF'; - $currentfilename = $file; - fatal_error qq(Missing "?END" to match ?IF at line number $lastref->[2]) - } - - $ifstack = $save_ifstack; - close IF; } } @@ -1624,7 +1615,7 @@ sub copy1( $ ) { if ( $script || $debug ) { my ( $do_indent, $here_documents ) = ( 1, ''); - my $save_ifstack = $ifstack; + open_file( $_[0] ); while ( $currentfile ) { @@ -1633,13 +1624,6 @@ sub copy1( $ ) { chomp; - if ( /^\s*\?(IF\s+|ELSE|ENDIF)(.*)$/ ) { - $omitting = process_conditional( $omitting, $1, $2 ); - next; - } - - next if $omitting; - if ( /^${here_documents}\s*$/ ) { if ( $script ) { print $script $here_documents if $here_documents; @@ -1722,15 +1706,6 @@ sub copy1( $ ) { } } - unless( $save_ifstack == @ifstack ) { - my $lastref = $ifstack[-1]; - $currentlinenumber = 'EOF'; - $currentfilename = $_[0]; - fatal_error qq(Missing "?END" to match ?IF at line number $lastref->[2]) - } - - $ifstack = $save_ifstack; - close_file; } } @@ -1759,8 +1734,6 @@ sub copy2( $$ ) { } unless ( $empty ) { - my $save_ifstack = $ifstack; - emit < ) { - if ( /^\s*\?(IF\s+|ELSE|ENDIF)(.*)$/ ) { - $omitting = process_conditional( $omitting, $1, $2 ); - next; - } - - next if $omitting; - chomp; - if ( /^\s*$/ ) { unless ( $lastlineblank ) { print $script "\n" if $script; @@ -1806,15 +1771,6 @@ EOF } } - unless( $save_ifstack == @ifstack ) { - my $lastref = $ifstack[-1]; - $currentlinenumber = 'EOF'; - $currentfilename = $file; - fatal_error qq(Missing "?END" to match ?IF at line number $lastref->[2]) - } - - $ifstack = $save_ifstack; - close IF; unless ( $lastlineblank ) {