From: Brandon Casey Date: Mon, 27 Sep 2010 03:18:01 +0000 (-0500) Subject: git-send-email.perl: ensure $domain is defined before using it X-Git-Tag: v1.7.3.1~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=61ef5e9b56e1c16f6d3c142e2c63f6e2c720c64e;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/git-send-email.perl b/git-send-email.perl index 6dab3bf6a..e1f29a72a 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -895,7 +895,7 @@ sub sanitize_address { sub valid_fqdn { my $domain = shift; - return !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./; + return defined $domain && !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./; } sub maildomain_net {