File: 0005-only-the-final-angle-addr-in-the-parse-contains-addr.patch

package info (click to toggle)
libemail-address-perl 1.895-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 452 kB
  • sloc: perl: 276; makefile: 9
file content (26 lines) | stat: -rw-r--r-- 854 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From a53513e3a07c3f9dde99158c22273ba51be40fae Mon Sep 17 00:00:00 2001
From: Ricardo Signes <rjbs@cpan.org>
Date: Sat, 14 Jun 2014 00:17:19 -0400
Subject: [PATCH 5/8] only the final angle-addr in the parse contains addr

this is such a bodge :(
---
 lib/Email/Address.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Email/Address.pm b/lib/Email/Address.pm
index a50402e..acece12 100644
--- a/lib/Email/Address.pm
+++ b/lib/Email/Address.pm
@@ -221,7 +221,7 @@ sub parse {
       s/$comment//go if @comments;
 
       my ($user, $host, $com);
-      ($user, $host) = ($1, $2) if s/<($local_part)\@($domain)>//o;
+      ($user, $host) = ($1, $2) if s/<($local_part)\@($domain)>\s*\z//o;
       if (! defined($user) || ! defined($host)) {
           s/($local_part)\@($domain)//o;
           ($user, $host) = ($1, $2);
-- 
2.0.0