Make buildports.pl a little more bulletproof

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6637 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-06-21 17:44:41 +00:00
parent 60857f0518
commit a649be0f53

View File

@ -41,10 +41,12 @@ sub print_it( $$ ) {
my $length = length $name;
if ( $name =~ /\W/ || $name =~ /^\d/ ) {
$tabs = "\t" x int ( ( 27 - $length ) / 8 );
my $repeat = int ( ( 27 - $length ) / 8 );
$tabs = $repeat > 0 ? "\t" x $repeat : ' ';
print "${offset}'${name}'${tabs}=> $number,\n";
} else {
$tabs = "\t" x int ( ( 29 - $length ) / 8 );
my $repeat = int ( ( 29 - $length ) / 8 );
$tabs = $repeat > 0 ? "\t" x $repeat : ' ';
print "${offset}${name}${tabs}=> $number,\n";
}
}