Skip to content

Commit 904f6e7

Browse files
computersforpeacegitster
authored andcommitted
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 <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0f2e68b commit 904f6e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-send-email.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ sub smtp_auth_maybe {
11421142

11431143
# Check mechanism naming as defined in:
11441144
# https://tools.ietf.org/html/rfc4422#page-8
1145-
if ($smtp_auth !~ /^(\b[A-Z0-9-_]{1,20}\s*)*$/) {
1145+
if ($smtp_auth && $smtp_auth !~ /^(\b[A-Z0-9-_]{1,20}\s*)*$/) {
11461146
die "invalid smtp auth: '${smtp_auth}'";
11471147
}
11481148

0 commit comments

Comments
 (0)