Re: [PATCH] git-send-email.perl: avoid printing undef when validating addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Taylor Blau <me@xxxxxxxxxxxx> writes:

> diff --git a/git-send-email.perl b/git-send-email.perl
> index 897cea6564..288ea1ae80 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1166,10 +1166,10 @@ sub extract_valid_address {
>  
>  sub extract_valid_address_or_die {
>  	my $address = shift;
> +	my $valid_address = extract_valid_address($address);
>  	die sprintf(__("error: unable to extract a valid address from: %s\n"), $address)
> +		if !$valid_address;
> +	return $valid_address;

This will still use undef if the incoming $address is already undef,
but the caller deserves what it gets in such a case.  The message
reports that the %s is the source from which the code tried to
extract the address from, not the result of failed extraction, so
the rewrite is absolutely the right thing to do.

Will queue.  Thanks.


>  }
>  
>  sub validate_address {



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux