summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorst H. von Brand <vonbrand@inf.utfsm.cl>2006-06-03 17:11:48 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-04 07:00:20 (GMT)
commite96fd30553bb57a76ad38f703a3fea5b53c45ff9 (patch)
tree85f6a45b1df4edb6ca62fe16463a0fd1bdcbef84
parent16a4c6ee0d9a3d07d4d0afbbc4e3467e78065eca (diff)
downloadgit-e96fd30553bb57a76ad38f703a3fea5b53c45ff9.zip
git-e96fd30553bb57a76ad38f703a3fea5b53c45ff9.tar.gz
git-e96fd30553bb57a76ad38f703a3fea5b53c45ff9.tar.bz2
Cleanup git-send-email.perl:extract_valid_email
- Fix the regular expressions for local addresses - Fix the fallback regexp for non-local addresses, simplify the logic Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-send-email.perl9
1 files changed, 3 insertions, 6 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index ed1d89b..a7a7797 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -314,18 +314,15 @@ 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
- my $cleaned_address;
- if ($address =~ /([^\"<>\s]+@[^<>\s]+)/) {
- $cleaned_address = $1;
- }
- return $cleaned_address;
+ $address =~ /([\w\-.]+@[\w\-.]+)/;
+ return $1;
}
}