mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib readmail.pl,2.39,2.40

2011-01-02 03:38:08
Update of mhonarc/MHonArc/lib
Modified Files:
	readmail.pl 
Log Message:
Bug #18908: In non-ASCII decoder, translate CRs and LFs to spaces.
I do not think CRs and LFs should be encoded, but example cited
in bug item has a LF character (=A0) in the encoded string, causing
the newline to get introduced in output.


======================================================================
FILE: mhonarc/MHonArc/lib/readmail.pl
<http://www.mhonarc.org/cgi-bin/viewcvs.cgi/*checkout*/mhonarc/MHonArc/lib/readmail.pl?rev=2.40>

<http://www.mhonarc.org/cgi-bin/viewcvs.cgi/mhonarc/MHonArc/lib/readmail.pl.diff?r1=2.39&r2=2.40&diff_format=h>
--- readmail.pl	1 Jan 2011 22:33:19 -0000	2.39
+++ readmail.pl	2 Jan 2011 09:38:05 -0000	2.40
@@ -400,4 +400,5 @@
             $strtxt =~ s/_/ /g;
             $strtxt =  &$dec($strtxt);
+            $strtxt =~ s/[\r\n]/ /g;
             &$encfunc(\$strtxt, $real_charset, $TextEncode);
             $ret   .= $strtxt;
@@ -414,5 +415,7 @@
             if ($charcnv eq '-decode-') {
                 $strtxt =~ s/_/ /g;
-                $ret .= &$dec($strtxt);
+                $strtxt =  &$dec($strtxt);
+                $strtxt =~ s/[\r\n]/ /g;
+                $ret .= $strtxt;
 
             # Ignore if just decoding
@@ -423,5 +426,7 @@
             } elsif (defined(&$charcnv)) {
                 $strtxt =~ s/_/ /g;
-                $ret .= &$charcnv(&$dec($strtxt), $real_charset);
+                $strtxt =  &$dec($strtxt);
+                $strtxt =~ s/[\r\n]/ /g;
+                $ret .= &$charcnv($strtxt, $real_charset);
 
             # Fallback is to ignore

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-COMMITS