Fix undefined hash reference warning

This fixes a bug introduced in commit
5e3e10d32e

For some reason Perl is OK with:

    my $x = undef;
    my @k = keys(%$x);  # empty list, no warnings

but not:

    my $x = undef;
    my %h = %$x;
    my @k = keys(%h);
This commit is contained in:
Richard Hansen 2024-06-29 02:14:16 -04:00
parent de39ac7bcc
commit be3c2060eb

View file

@ -1950,7 +1950,7 @@ sub init_config {
## merge options into host definitions or globals ## merge options into host definitions or globals
if (@hosts) { if (@hosts) {
for my $h (@hosts) { for my $h (@hosts) {
$config{$h} = {%{$config{$h}}, %options}; $config{$h} = {%{$config{$h} // {}}, %options};
} }
$opt{'host'} = join(',', @hosts); $opt{'host'} = join(',', @hosts);
} else { } else {