From e8b90f89a3579e9c68290ac47302005f65dbbf43 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 22 Mar 2017 09:46:52 -0700 Subject: [PATCH] Clean up column/value pair editing. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index ff16c98b3..7aa811274 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2437,12 +2437,12 @@ sub split_line2( $$;$$$ ) { } } else { fatal_error "Unknown column ($1)" unless exists $columnsref->{$column}; - $column = $columnsref->{$column}; - fatal_error "Non-ASCII gunk in file" if $columns =~ /[^\s[:print:]]/; $value = $1 if $value =~ /^"([^"]+)"$/; $value =~ s/\\"/"/g; - fatal_error "Non-ASCII gunk in the value of the $column column" if $columns =~ /[^\s[:print:]]/; - $line[$column] = $value; + fatal_error "Non-ASCII gunk in the value of the $column column" if $value =~ /[^\s[:print:]]/; + my $colnum = $columnsref->{$column}; + warning_message qq(Replacing "$line[$colnum]" with "$value" in the ) . uc( $column ) . ' column' if $line[$colnum] ne '-'; + $line[$colnum] = $value; } } }