From f6d5ce3383173f0278079358dde58edfac3e3ac5 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 13 Jun 2020 11:47:45 -0400 Subject: [PATCH] Fix global fallback when host-specific setting is undefined This commit only changes behavior if the hostname is a falsy string (`''` or `'0'`) and there is a variable that: * was not set globally before the host definition, * was not set in the host definition, * was set globally after the host definition, and * is relevant to the host. --- ddclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddclient b/ddclient index ccd55a6..517abca 100755 --- a/ddclient +++ b/ddclient @@ -1708,7 +1708,7 @@ sub minimum { sub opt { my $v = shift; my $h = shift; - return $config{$h}{$v} if defined($h && $config{$h}{$v}); + return $config{$h}{$v} if defined($h) && defined($config{$h}{$v}); return $opt{$v} if defined $opt{$v}; return $globals{$v} if defined $globals{$v}; return default($v) if defined default($v);