diff options
author | Eric Wong <e@80x24.org> | 2016-07-01 06:11:13 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-01 06:11:13 +0000 |
commit | c056071159932b3b9c8454314887b6f45de2ae0f (patch) | |
tree | 94bfc8e945f84ca25fdef98c6c372f7dac0645de /lib | |
parent | a5719018b856d1763ca7faebfc0ffa82fb57320a (diff) | |
download | public-inbox-c056071159932b3b9c8454314887b6f45de2ae0f.tar.gz |
It seems common for address entries to end up as: "foo@example" <foo@example> Avoid needlessly displaying the domain name in that case.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/Address.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/Address.pm b/lib/PublicInbox/Address.pm index cd5fbfbe..e17d0b57 100644 --- a/lib/PublicInbox/Address.pm +++ b/lib/PublicInbox/Address.pm @@ -16,7 +16,9 @@ sub names { my $e = $1; s/\A['"\s]*//; s/['"\s]*\z//; - $_ =~ /\S/ ? $_ : $e; + $e = $_ =~ /\S/ ? $_ : $e; + $e =~ s/\@\S+\z//; + $e; } split(/\@+[\w\.\-]+>?\s*(?:,\s*|\z)/, $_[0]); } |