threads / patch / 4329

patchgit-send-email.perl extract_valid_address issue

Subject: [PATCH] git-send-email.perl extract_valid_address issue

## tl;dr

2 messages between May 29, 2006 and May 29, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Nicolas Troncoso Carrere· May 29, 2006, 04:00 UTC · lore

The third fallback was returning if the match was done or not instead of returning the actual email address that was matched. This prevented sending the mail to the people included in the CC. This bug only affect those that dont have Email::Valid.

I initialized $valid_email as undef so it would mimic the behavior of Email::Verify->address(), which returns undef if no valid address was found.

Signed-off-by: Nicolas <ntroncos@inf.utfsm.cl>
---
 git-send-email.perl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
84853ca89c15de7a24e9eb9fd422654b86c63be9
Show changes to git-send-email.perl +3 −1
diff --git a/git-send-email.perl b/git-send-email.perl
index 312a4ea..dfff3e6 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -316,7 +316,9 @@ sub extract_valid_address {
 	} else {
 		# less robust/correct than the monster regexp in Email::Valid,
 		# but still does a 99% job, and one less dependency
-		return ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
+                my $valid_email=undef;
+                ($valid_email ) = ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
+                return ($valid_email);
 	}
 }
-- 
Nicolás Troncoso Carrère                        User #272312 counter.li.org
Estudiante Magíster en Ciencias de la Informática
Universidad Técnica Federico Santa María
http://www.alumnos.inf.utfsm.cl/~ntroncos
Ryan Anderson· May 29, 2006, 20:00 UTC · re: Nicolas Troncoso Carrere · lore

Re: [PATCH] git-send-email.perl extract_valid_address issue

On Mon, May 29, 2006 at 12:00:44AM -0400, Nicolas Troncoso Carrere wrote:
Show 8 quoted lines
> 
> The third fallback was returning if the match was done or not instead of
> returning the actual email address that was matched. This prevented sending
> the mail to the people included in the CC. This bug only affect those that
> dont have Email::Valid.
> 
> I initialized $valid_email as undef so it would mimic the behavior of 
> Email::Verify->address(), which returns undef if no valid address was found.
Odd, I noticed the same thing this weekend.
> Signed-off-by: Nicolas <ntroncos@inf.utfsm.cl>
Acked-by: Ryan Anderson <ryan@michonline.com>
(Or pick up my patch that fixes this in a slightly different way)
Show 32 quoted lines
> 
> 
> ---
> 
>  git-send-email.perl |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> 84853ca89c15de7a24e9eb9fd422654b86c63be9
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 312a4ea..dfff3e6 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -316,7 +316,9 @@ sub extract_valid_address {
>  	} else {
>  		# less robust/correct than the monster regexp in Email::Valid,
>  		# but still does a 99% job, and one less dependency
> -		return ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
> +                my $valid_email=undef;
> +                ($valid_email ) = ($address =~ /([^\"<>\s]+@[^<>\s]+)/);
> +                return ($valid_email);
>  	}
>  }
> -- 
> Nicol?s Troncoso Carr?re                        User #272312 counter.li.org
> Estudiante Mag?ster en Ciencias de la Inform?tica
> Universidad T?cnica Federico Santa Mar?a
> http://www.alumnos.inf.utfsm.cl/~ntroncos
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

← back to recent threads