[Debian-l10n-commits] r1036 - /dl10n/trunk/lib/Debian/L10n/Spider.pm

nekral-guest at users.alioth.debian.org nekral-guest at users.alioth.debian.org
Thu May 29 23:42:27 UTC 2008


Author: nekral-guest
Date: Thu May 29 23:42:26 2008
New Revision: 1036

URL: http://svn.debian.org/wsvn/?sc=1&rev=1036
Log:
Try to circumvent an issue due to mutt's header-line wrapping algorithm.
Remove tabulations in {...} constructs if it looks like a dl10n subject.
Restricting this change to {...} constructs should be sufficient since
these are the one which require long subjects.

Modified:
    dl10n/trunk/lib/Debian/L10n/Spider.pm

Modified: dl10n/trunk/lib/Debian/L10n/Spider.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/L10n/Spider.pm?rev=1036&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/L10n/Spider.pm (original)
+++ dl10n/trunk/lib/Debian/L10n/Spider.pm Thu May 29 23:42:26 2008
@@ -106,13 +106,27 @@
 	my $subject = shift;
 	$subject =~ s/^Subject: //;
 
-	$subject =~ m/^\p{IsSpace}*\[([^\]]*)\].*?([^:\p{IsSpace}]*):\/\/(\P{IsSpace}*)/;
+	$subject =~ m/^\p{IsSpace}*\[([^\]]*)\].*?([^:\p{IsSpace}]*):\/\/(\P{IsSpace}*)(.*)$/;
 
 	return undef unless $1;
 
 	my $status = lc $1;
 	my $type   = lc $2;
 	my $names  =    $3;
+	my $subject_end = $4;
+
+	# Mutt split long subject and can introduce tabulations even if there were no spaces.
+	# We remove the tabulations if inside {}, which deals with most of the long subjects.
+	while (    defined $subject_end
+	       and $names =~ m/\{[^\}]*$/
+	       and $subject_end =~ m/^\t+(\S*)(.*)\}(.*)$/) {
+		$names .= $1;
+		$subject_end = $2."\}".$3;
+	}
+	if (defined $subject_end) {
+		$subject_end =~ m/^(\S+)/;
+		$names .= $1;
+	}
 
 	$status =~ s/\p{IsSpace}//g;
 	$status =~ s/#?\p{IsDigit}*$//;




More information about the Debian-l10n-commits mailing list