mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
Use open_file()/close_file() in copy1
This commit is contained in:
parent
978e8e3849
commit
5c4da0b581
@ -1195,6 +1195,8 @@ sub copy( $ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub close_file();
|
||||||
|
|
||||||
#
|
#
|
||||||
# This one handles line continuation and 'here documents'
|
# This one handles line continuation and 'here documents'
|
||||||
|
|
||||||
@ -1204,13 +1206,12 @@ sub copy1( $ ) {
|
|||||||
my $result = 0;
|
my $result = 0;
|
||||||
|
|
||||||
if ( $script || $debug ) {
|
if ( $script || $debug ) {
|
||||||
my $file = $_[0];
|
|
||||||
|
|
||||||
open IF , $file or fatal_error "Unable to open $file: $!";
|
|
||||||
|
|
||||||
my ( $do_indent, $here_documents ) = ( 1, '');
|
my ( $do_indent, $here_documents ) = ( 1, '');
|
||||||
|
|
||||||
while ( <IF> ) {
|
open_file( $_[0] );
|
||||||
|
|
||||||
|
while ( $currentfile ) {
|
||||||
|
while ( <$currentfile> ) {
|
||||||
chomp;
|
chomp;
|
||||||
|
|
||||||
if ( /^${here_documents}\s*$/ ) {
|
if ( /^${here_documents}\s*$/ ) {
|
||||||
@ -1269,7 +1270,8 @@ sub copy1( $ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close IF;
|
close_file;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$lastlineblank = 0;
|
$lastlineblank = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user