git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] send-email: fix uninitialized var warning for $smtp_auth
@ 2015-09-18 22:12 Brian Norris
  2015-09-18 22:25 ` Eric Sunshine
  2015-09-21 17:52 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Brian Norris @ 2015-09-18 22:12 UTC (permalink / raw)
  To: git; +Cc: Brian Norris, Jan Viktorin, Eric Sunshine, Junio C Hamano

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 /usr/local/google/home/briannorris/git/git/git-send-email.perl line 1139.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Jan Viktorin <viktorin@rehivetech.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>
Cc: Junio C Hamano <gitster@pobox.com>
---
 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 c5a3f766f7fd..e3ff44b4d0cd 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1136,7 +1136,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}'";
 	}
 
-- 
2.6.0.rc0.131.gf624c3d

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-21 17:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-18 22:12 [PATCH] send-email: fix uninitialized var warning for $smtp_auth Brian Norris
2015-09-18 22:25 ` Eric Sunshine
2015-09-18 22:42   ` Brian Norris
2015-09-18 22:47     ` Eric Sunshine
2015-09-18 22:50       ` Brian Norris
2015-09-21 17:52 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).