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: $!";
while ( my $line = <IF> ) {
$line =~ s/^/$indent/ if $indent;
print $object $line;
while ( <IF> ) {
s/^/$indent/ if $indent;
print $object $_;
}
close IF;
@ -238,16 +238,16 @@ sub copy1( $ ) {
my $do_indent = 1;
while ( my $line = <IF> ) {
if ( $line =~ /^\s+$/ ) {
while ( <IF> ) {
if ( /^\s+$/ ) {
print $object "\n";
$do_indent = 1;
next;
}
$line =~ s/^/$indent/ if $indent && $do_indent;
print $object $line;
$do_indent = ! ( $line =~ /\\$/ );
s/^/$indent/ if $indent && $do_indent;
print $object $_;
$do_indent = ! ( /\\$/ );
}
close IF;

View File

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