From 904f6e7c15ab50c02048f50002d8f72b9ed74075 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 18 Sep 2015 15:12:50 -0700 Subject: [PATCH] send-email: fix uninitialized var warning for $smtp_auth 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 Reviewed-by: Eric Sunshine Signed-off-by: Junio C Hamano --- git-send-email.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}'"; }