2
===================================================================
3
RCS file: /cvsroot/amavisd-new/amavisd-new/amavisd,v
4
retrieving revision 1.1.1.15
5
retrieving revision 1.44
6
diff -u -r1.1.1.15 -r1.44
7
--- amavisd 21 Aug 2005 23:46:15 -0000 1.1.1.15
8
+++ amavisd 25 Feb 2006 15:59:35 -0000 1.44
9
@@ -3778,17 +3801,23 @@
10
$str =~ s/\n([ \t]*\n)+/\n/g; # remove empty lines
11
chomp($str); # chop off trailing NL if present
13
+ $str =~ s/[ \t]+/ /g; # collapse spaces and tabs to a single space
14
my(@sublines) = split(/\n/, $str, -1);
15
- $str = ''; my($s) = ''; my($s_l) = 0;
16
+ $str = ''; my($s) = ''; my($s_l) = 0; my($s_il)=0;
17
for (@sublines) { # join shorter field sections
18
- if ($s !~ /^\s*\z/ && $s_l + length($_) > 78) {
19
- $str .= "\n" if $str ne '';
20
+ if ($s !~ /^\s*\z/ && $s_l + $s_il + length($_) > 78) {
21
+ $s_il = 8; # length of the initial tab
22
+ $str .= "\n\t" if $str ne '';
23
+ $s =~ s/^[ \t]+//g; # remove leading and trailing whitespace
25
$str .= $s; $s = ''; $s_l = 0;
27
$s .= $_; $s_l += length($_);
30
- $str .= "\n" if $str ne '';
31
+ $str .= "\n\t" if $str ne '';
32
+ $s =~ s/^[ \t]+//g; # remove leading and trailing whitespace
36
} elsif (length($str) > 998) {