From 63a2a32b4b0f2e51fed200b60f20b84579fb5f65 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 14 Apr 2012 13:50:59 -0700 Subject: [PATCH] Suppress trailing whitespace. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 156e63c3a..7dbbf7602 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2230,13 +2230,20 @@ sub read_a_line($) { } } # - # Now remove concatinated comments + # Now remove concatinated comments if asked # $currentline =~ s/\s*#.*$// if $options & STRIP_COMMENTS; - # - # Ignore ( concatenated ) Blank Lines after comments are removed. - # - $currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/ && ( $options & SUPPRESS_WHITESPACE ); + + if ( $options & SUPPRESS_WHITESPACE ) { + # + # Ignore (concatinated) blank lines + # + $currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/; + # + # Eliminate trailing whitespace + # + $currentline =~ s/\s*$//; + } # # Line not blank -- Handle any first-entry message/capabilities check #