From: Brandon Casey <drafnel@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, brian@gernhardtsoftware.com,
Brandon Casey <drafnel@gmail.com>
Subject: [PATCH] git-send-email.perl: ensure $domain is defined before using it
Date: Sun, 26 Sep 2010 22:18:01 -0500 [thread overview]
Message-ID: <1285557481-16357-1-git-send-email-drafnel@gmail.com> (raw)
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>
---
git-send-email.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 6dab3bf..e1f29a7 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 {
--
1.7.3.1.geb284
next reply other threads:[~2010-09-27 3:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-27 3:18 Brandon Casey [this message]
2010-09-27 22:19 ` [PATCH] git-send-email.perl: ensure $domain is defined before using it Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1285557481-16357-1-git-send-email-drafnel@gmail.com \
--to=drafnel@gmail.com \
--cc=brian@gernhardtsoftware.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.