summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-09-18 15:12:50 -0700
committerJunio C Hamano <gitster@pobox.com>2015-09-21 10:51:19 -0700
commit904f6e7c15ab50c02048f50002d8f72b9ed74075 (patch)
treef97b315e805caa2dce4941aaf2e1248fc1dfc6d6
parent0f2e68b54c7f85656299539de8a4aebab795d369 (diff)
downloadgit-bn/send-email-smtp-auth-error-message-fix.tar.gz
send-email: fix uninitialized var warning for $smtp_authbn/send-email-smtp-auth-error-message-fix
On the latest version of git-send-email, I see this error just before running SMTP auth (I didn't provide any --smtp-auth= parameter): Use of uninitialized value $smtp_auth in pattern match (m//) at \ /home/briannorris/git/git/git-send-email.perl line 1139. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-send-email.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 6e380a25be..cfe26e5029 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1142,7 +1142,7 @@ sub smtp_auth_maybe {
# Check mechanism naming as defined in:
# https://tools.ietf.org/html/rfc4422#page-8
- if ($smtp_auth !~ /^(\b[A-Z0-9-_]{1,20}\s*)*$/) {
+ if ($smtp_auth && $smtp_auth !~ /^(\b[A-Z0-9-_]{1,20}\s*)*$/) {
die "invalid smtp auth: '${smtp_auth}'";
}