From decf9d3b3e38eefede2c295133124efca20452a1 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 30 Jul 2016 09:03:19 -0700 Subject: [PATCH] Correct comment formatting in 'trace' output Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 03f6b4fa8..747096482 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1337,7 +1337,14 @@ sub push_rule( $$ ) { push @{$chainref->{rules}}, $ruleref; $chainref->{referenced} = 1; $chainref->{optflags} |= RETURNS_DONT_MOVE if ( $ruleref->{target} || '' ) eq 'RETURN'; - trace( $chainref, 'A', @{$chainref->{rules}}, "-A $chainref->{name} $_[1] $ruleref->{comment}" ) if $debug; + + if ( $debug ) { + if ( $ruleref->{comment} ) { + trace( $chainref, 'A', @{$chainref->{rules}}, "-A $chainref->{name} $_[1] -m comment --comment \"$ruleref->{comment}\"" ); + } else { + trace( $chainref, 'A', @{$chainref->{rules}}, "-A $chainref->{name} $_[1]" ); + } + } $chainref->{complete} = 1 if $complete;