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

From: Eric Wong <normalperson@yhbt.net>
Date: 2006-05-30 08:12:40
Horst von Brand <vonbrand@inf.utfsm.cl> wrote:
> Fix regexps to better match email addresses if Email::Valid isn't present
> Make it return the address on match containing a @
> 
> Signed-off-by:  Horst H. von Brand <vonbrand@inf.utfsm.cl>
> ---
>  git-send-email.perl |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 312a4ea..6e39f2f 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -309,14 +309,14 @@ sub extract_valid_address {
>  	my $address = shift;
>  
>  	# check for a local address:
> -	return $address if ($address =~ /^([\w\-]+)$/);
> +	return $address if ($address =~ /^([\w\-.]+)$/);
>  
>  	if ($have_email_valid) {
>  		return Email::Valid->address($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]+)/);
> +		return ($address =~ /([\w\-.]+@[\w\-.]+)/) ? $1 : undef;
>  	}
>  }

Oops on the original bug, my fault :x
Acked-by: Eric Wong <normalperson@yhbt.net>

-- 
Eric Wong
-
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
Received on Tue May 30 08:13:17 2006

This archive was generated by hypermail 2.1.8 : 2006-05-30 08:13:36 EST