From f162d6383b800a4f1ce2ae2406e6778df550a476 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Tue, 14 Jul 2015 17:32:25 +0200
Subject: [PATCH] Locale::Po4a::Text: Remove support for broken timezone names
Status: sent
Debbug: 792416
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The Debian changelog trailer regex intended to support a timezone name
inside parenthesis, like this:

 -- Name <mail@example.org>  Sat, 30 May 2015 03:18:43 +0200 (CEST)

is bogus, and it only accepts one character. As in:

 -- Name <mail@example.org>  Sat, 30 May 2015 03:18:43 +0200 (C)

which while also “valid”, as per RFC822, they are pretty much useless
as per RFC5322. It seems the regex was “inherited” from the dpkg
implementation which has kept that part unchanged since its inception
in dpkg 1.3.0, 1996-08.

So let's just drop it instead of fixing the regex, given that the
timezone name has never been accepted, many time-parsing functions
ignore it, it is redundant, declared obsolete by RFC5322 and Debian
policy dropped an explicit reference to it due to bug 569174.

Signed-off-by: Guillem Jover <guillem@debian.org>
---
 lib/Locale/Po4a/Text.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Locale/Po4a/Text.pm b/lib/Locale/Po4a/Text.pm
index 1249e67..f1a0988 100644
--- a/lib/Locale/Po4a/Text.pm
+++ b/lib/Locale/Po4a/Text.pm
@@ -289,7 +289,7 @@ sub parse_debianchangelog {
         $paragraph="";
         $self->pushline("$line\n");
         $expect_header=0;
-    } elsif ($line =~ m/^ \-\- (.*) <(.*)>  ((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4}(\s+\([^\\\(\)]\))?)$/) {
+    } elsif ($line =~ m/^ \-\- (.*) <(.*)>  ((\w+\,\s*)?\d{1,2}\s+\w+\s+\d{4}\s+\d{1,2}:\d\d:\d\d\s+[-+]\d{4})$/) {
         # Found trailer
         do_paragraph($self,$paragraph,$wrapped_mode);
         $paragraph="";
-- 
2.4.3.573.g4eafbef

