From e3aa8fd4498523c1f8d15e6c474c0bcc33b501d9 Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 30 Mar 2007 23:29:13 +0000 Subject: [PATCH] Better solution to line image beautification git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5765 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Common.pm | 4 +++- New/Shorewall/Config.pm | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/New/Shorewall/Common.pm b/New/Shorewall/Common.pm index b709df791..c91f80075 100644 --- a/New/Shorewall/Common.pm +++ b/New/Shorewall/Common.pm @@ -181,7 +181,9 @@ sub timestamp() { sub progress_message { if ( $verbose > 1 ) { timestamp if $ENV{TIMESTAMP}; - print "@_\n"; + my $line = join( ' ', @_ ); + $line =~ s/\s+/ /g; + print "$line\n"; } } diff --git a/New/Shorewall/Config.pm b/New/Shorewall/Config.pm index 0efd43c43..c2601168e 100644 --- a/New/Shorewall/Config.pm +++ b/New/Shorewall/Config.pm @@ -353,7 +353,6 @@ sub pop_open() { # # - Ignore blank or comment-only lines. # - Remove trailing comments. -# - Compress out extra whitespace. # - Handle Line Continuation (We don't continue comment lines, thus avoiding user frustration # when the last line of a comment inadvertently ends with '\'). # - Expand shell variables from $ENV. @@ -373,7 +372,6 @@ sub read_a_line { $nextline =~ s/#.*$//; chomp $nextline; - $nextline =~ s/\s+/ /g if $verbose >= 2; if ( substr( $nextline, -1, 1 ) eq '\\' ) { $line .= substr( $nextline, 0, -1 ); @@ -511,7 +509,7 @@ sub get_configuration() { next if $line =~ /^\s*#/; next if $line =~ /^\s*$/; - if ( $line =~ /^([a-zA-Z]\w*)=(.*)$/ ) { + if ( $line =~ /^([a-zA-Z]\w*)=(.*?)\s*$/ ) { my ($var, $val) = ($1, $2); unless ( exists $capabilities{$var} ) { warning_message "Unknown capability \"$var\" ignored";