From b14abd9a9b018a23bfd8b89e8c1d9fd16077dab3 Mon Sep 17 00:00:00 2001 From: Gerfried Fuchs Date: Wed, 17 Feb 2010 20:54:44 +0100 Subject: [PATCH] Imported Upstream version 2.8 --- ChangeLog | 14 +++++++++++ ...r1.261-gol.diff => t-prot-r1.264-gol.diff} | 12 +++++----- t-prot | 23 ++++++++----------- t-prot.1 | 7 +++--- 4 files changed, 33 insertions(+), 23 deletions(-) rename contrib/{t-prot-r1.261-gol.diff => t-prot-r1.264-gol.diff} (96%) diff --git a/ChangeLog b/ChangeLog index 0efeca9..fab8d70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-12-19 22:18 Jochen Striepe + + * t-prot: Release as v2.8. + +2009-12-18 21:53 Jochen Striepe + + * t-prot, t-prot.1: Update documentation to reflect last change. + Avoid being tripped by endless (or non-existant) headers. + +2009-12-18 13:25 Jochen Striepe + + * t-prot: Change check order and remove duplicated code for + --max-lines. + 2009-08-24 20:32 Jochen Striepe * t-prot: Release as t-prot v2.7. diff --git a/contrib/t-prot-r1.261-gol.diff b/contrib/t-prot-r1.264-gol.diff similarity index 96% rename from contrib/t-prot-r1.261-gol.diff rename to contrib/t-prot-r1.264-gol.diff index a73a077..a3a0e74 100644 --- a/contrib/t-prot-r1.261-gol.diff +++ b/contrib/t-prot-r1.264-gol.diff @@ -1,15 +1,15 @@ ---- t-prot 2009-08-24 22:32:11.000000000 +0200 -+++ t-prot-gol 2009-08-24 22:37:25.000000000 +0200 +--- t-prot 2009-12-19 23:22:08.000000000 +0100 ++++ t-prot-gol 2009-12-19 23:22:13.000000000 +0100 @@ -4,7 +4,7 @@ require 5.006; use strict; use Fcntl qw(O_EXCL O_WRONLY O_CREAT); -use Getopt::Mixed qw(nextOption); +use Getopt::Long qw(:config gnu_getopt no_ignore_case); - use constant VER => '2.7'; + use constant VER => '2.8'; use constant REV => ''; - use constant REL => q$Revision: 1.261 $=~m/(\d+(?:\.\d+)+)/; -@@ -925,83 +925,82 @@ + use constant REL => q$Revision: 1.264 $=~m/(\d+(?:\.\d+)+)/; +@@ -920,83 +920,82 @@ (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); my $ifile = '-'; # use STDIN if nothing specified @@ -165,7 +165,7 @@ if ($mua eq 'mutt') { if (defined $locale && $locale ne '' && $locale ne 'C' && $locale ne 'POSIX') { -@@ -1063,11 +1062,15 @@ +@@ -1058,11 +1057,15 @@ m/^([^%]*)/; } } diff --git a/t-prot b/t-prot index bf3a0a1..c4b06b2 100755 --- a/t-prot +++ b/t-prot @@ -1,13 +1,13 @@ #!/usr/bin/perl -w -# $Id: t-prot,v 1.261 2009/08/24 20:32:11 jochen Exp $ +# $Id: t-prot,v 1.264 2009/12/19 22:18:47 jochen Exp $ require 5.006; use strict; use Fcntl qw(O_EXCL O_WRONLY O_CREAT); use Getopt::Mixed qw(nextOption); -use constant VER => '2.7'; +use constant VER => '2.8'; use constant REV => ''; -use constant REL => q$Revision: 1.261 $=~m/(\d+(?:\.\d+)+)/; +use constant REL => q$Revision: 1.264 $=~m/(\d+(?:\.\d+)+)/; # MTA expecting mail on STDIN # (you might have to adjust this if using a different MTA) use constant SENDMAIL => '/usr/sbin/sendmail -oi'; @@ -442,23 +442,18 @@ sub process_msg { my (@ads, @hdr, @bo1, @bo2, @ftr, @sig, @vrb, @att) = ((), (), (), (), (), (), (), (), ()); - # First, remove and store lines we might need later... + # First, check msg length and stop processing if msg is too long: + if ((defined $maxlines) && (@$lines > $maxlines)) { + return; + } + + # Remove and store lines we might need later... # Remove headers: if (!$nohdr) { for ($x=0; $x<$#$lines; $x++) { if (@$lines[$x] =~ /^$/) { last; }; } - - # check body length and stop processing silently if msg is too long: - if ((defined $maxlines) && (@$lines-$x > $maxlines)) { - return; - } - @hdr = @$lines[0..$x]; splice(@$lines, 0, $x+1); } - elsif ((defined $maxlines) && (@$lines > $maxlines)) { - # check body length and stop processing silently if msg is too long: - return; - } # remember the original body lines count my $linecount = scalar(@$lines); diff --git a/t-prot.1 b/t-prot.1 index a503ce0..468ed0a 100644 --- a/t-prot.1 +++ b/t-prot.1 @@ -1,4 +1,4 @@ -.\" $Id: t-prot.1,v 1.134 2009/08/24 01:44:27 jochen Exp $ +.\" $Id: t-prot.1,v 1.135 2009/12/18 21:53:17 jochen Exp $ .\" .TH T-PROT "1" "August 2009" "T-PROT" .SH NAME @@ -306,8 +306,9 @@ Requires .BR "\-m" . .TP .BR "\-\-max\-lines" =x -Maximum number of lines a message body may count. If the body is longer -than x lines, the message will not be processed but printed unmodified. +Maximum number of lines a message may count (with headers). If the message +is longer than x lines, the message will not be processed but printed +unmodified. .TP .BR "\-o" =FILE "output file": -- 2.39.2