Some code simplification

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5768 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-31 00:27:36 +00:00
parent b3d2f566d5
commit f962f76828
2 changed files with 9 additions and 9 deletions

View File

@ -221,9 +221,9 @@ sub copy( $ ) {
open IF , $file or fatal_error "Unable to open $file: $!"; open IF , $file or fatal_error "Unable to open $file: $!";
while ( my $line = <IF> ) { while ( <IF> ) {
$line =~ s/^/$indent/ if $indent; s/^/$indent/ if $indent;
print $object $line; print $object $_;
} }
close IF; close IF;
@ -238,16 +238,16 @@ sub copy1( $ ) {
my $do_indent = 1; my $do_indent = 1;
while ( my $line = <IF> ) { while ( <IF> ) {
if ( $line =~ /^\s+$/ ) { if ( /^\s+$/ ) {
print $object "\n"; print $object "\n";
$do_indent = 1; $do_indent = 1;
next; next;
} }
$line =~ s/^/$indent/ if $indent && $do_indent; s/^/$indent/ if $indent && $do_indent;
print $object $line; print $object $_;
$do_indent = ! ( $line =~ /\\$/ ); $do_indent = ! ( /\\$/ );
} }
close IF; close IF;

View File

@ -399,7 +399,7 @@ sub read_a_line {
open $currentfile, $filename or fatal_error "Unable to open $filename: $!"; open $currentfile, $filename or fatal_error "Unable to open $filename: $!";
$currentfilename = $filename; $currentfilename = $filename;
$currentlinenumber = 0; $currentlinenumber = 0;
$line=''; $line = '';
} else { } else {
return 1; return 1;
} }