@matheusbsbs / matheus-bagliano / commits / 61ef5e9b56
Fork 0

git-send-email.perl: ensure $domain is defined before using it

valid_fqdn() may attempt to operate on an undefined value if Net::Domain::domainname fails to determine the domain name. This causes perl to emit unpleasant warnings. So, add a check for whether $domain has been defined before using it. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Sep 26, 2010 at 22:18 UTC 61ef5e9b56e1c16f6d3c142e2c63f6e2c720c64e
1 file changed +1 -1
git-send-email.perl
+1 -1
@@ -895,7 +895,7 @@ sub sanitize_address {
895
896 sub valid_fqdn {
897 my $domain = shift;
898 - return !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
898 + return defined $domain && !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
899 }
900
901 sub maildomain_net {