You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2018/10/28 11:05:13 UTC

svn commit: r1845014 - /spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm

Author: hege
Date: Sun Oct 28 11:05:13 2018
New Revision: 1845014

URL: http://svn.apache.org/viewvc?rev=1845014&view=rev
Log:
Let wrap still use pre-5.14 method

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm?rev=1845014&r1=1845013&r2=1845014&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm Sun Oct 28 11:05:13 2018
@@ -767,7 +767,8 @@ sub wrap {
   my $pos = 0;
   my $pos_mod = 0;
   while ($#arr > $pos) {
-    my $len = length ($arr[$pos] =~ s/\t/        /gr);
+    my $len = length($arr[$pos]);
+    $len += ($arr[$pos] =~ tr/\t//) * 7; # add tab lengths
 
     # if we don't want to have lines > $length (overflow==0), we
     # need to verify what will happen with the next line.  if we don't
@@ -775,7 +776,8 @@ sub wrap {
     # line.
     # we also want this to be true for the first entry on the line
     if ($pos_mod != 0 && $overflow == 0) {
-      $len += length ($arr[$pos+1] =~ s/\t/        /gr);
+      $len += length($arr[$pos+1]);
+      $len += ($arr[$pos+1] =~ tr/\t//) * 7; # add tab lengths
     }
 
     if ($len <= $length) {