From fef0d8f83f5f2bf16dfb08b1e4a889efaed6b977 Mon Sep 17 00:00:00 2001 From: digimer Date: Tue, 27 Feb 2024 21:54:05 -0500 Subject: [PATCH] Fixed a spacing issue. Signed-off-by: digimer --- Anvil/Tools/System.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Anvil/Tools/System.pm b/Anvil/Tools/System.pm index 0e47c398..92752cc2 100644 --- a/Anvil/Tools/System.pm +++ b/Anvil/Tools/System.pm @@ -5484,7 +5484,7 @@ sub update_hosts # Push the IP into the array so that we print them in the order be first saw them. push @{$ip_order}, $ip_address; } - $lines->{$ip_address} .= $host_name; + $lines->{$ip_address} .= $host_name." "; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "lines->${ip_address}" => $lines->{$ip_address}, }}); @@ -5533,6 +5533,10 @@ sub update_hosts foreach my $ip_address (@{$ip_order}) { + # Clean off trailing white spaces. + $lines->{$ip_address} =~ s/\s+$//; + + # Add it. $new_body .= $lines->{$ip_address}."\n"; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { new_body => $new_body }}); }