git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] send-email: fix uninitialized var warning for $smtp_auth

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 21, 2015, 17:52 UTC
Message-ID
<xmqqr3lracd7.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1442614370-39880-1-git-send-email-computersforpeace@gmail.com>
Brian Norris <computersforpeace@gmail.com> writes:
Show 25 quoted lines
> 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}'";
>  	}
Thanks.
Previous: Brian Norris
Message 6 of 6 in “send-email: fix uninitialized var warning for $smtp_auth”
  1. send-email: fix uninitialized var warning for $smtp_authBrian Norris, Sep 18, 2015
  2. Eric SunshineSep 18, 2015
  3. Brian NorrisSep 18, 2015
  4. Eric SunshineSep 18, 2015
  5. Brian NorrisSep 18, 2015
  6. Junio C HamanoSep 21, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.