1 --- t-prot-x 2002-03-25 02:15:50.000000000 +0100
2 +++ t-prot 2002-03-25 03:24:03.000000000 +0100
9 $REL = q$Revision: 1.51 $; chop($REL);
11 # (you might have to adjust those if not using GNU libc)
13 my $S = shift; # array to store removed lines in
14 my $F = shift; # footers dir name
15 my $O = shift; # remove only one footer?
16 + my $V = shift; # allow footers match before end of message
18 if ($F && scalar(@$L)) {
19 opendir(DIR, $F) || die "Could not open $F: $!";
21 open(IN, "$F/$f") || die "Could not open $F/$f: $!";
24 + for (my $z=0; $z<=$#l; $z++) { chomp($l[$z]); }
26 - while (scalar(@l)<=scalar(@$L)) {
28 - for(my $x=1; $x<=scalar(@l); $x++) {
29 - chomp($l[scalar(@l)-$x]);
30 - if (index($$L[scalar(@$L)-$x], $l[scalar(@l)-$x])!=0) {
35 - unshift(@$S, @$L[$#$L-$#l..$#$L]);
36 - splice(@$L, $#$L-$#l);
37 - while (scalar(@$L) && $$L[$#$L] =~ /^\s*$/) {
38 - unshift(@$S, pop(@$L));
44 + WIPE: for (my $z=$V?(scalar(@$L)-scalar(@l)):0; $z>=0; $z--)
46 + if (scalar(@l)+$z<=scalar(@$L)) {
48 + for(my $x=1; $x<=scalar(@l); $x++) {
49 + if (index($$L[scalar(@$L)-$x-$z], $l[scalar(@l)-$x])!=0) {
54 + unshift(@$S, @$L[$#$L-$#l-$z..$#$L]);
55 + splice(@$L, $#$L-$#l-$z);
56 + while (scalar(@$L) && $$L[$#$L] =~ /^\s*$/) {
57 + unshift(@$S, pop(@$L));
59 + if ($O) { last; } else { goto WIPE; }
70 - remove_footers($lines, \@ftr, $footers, undef);
71 + remove_footers($lines, \@ftr, $footers, undef, undef);
74 - remove_footers($lines, \@ads, $ads, undef);
75 + remove_footers($lines, \@ads, $ads, undef, '1');
78 if (scalar(@$lines)) {