From d4a6a5adbe851a38f46c2d67eda71718e85c4892 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 25 Aug 2000 21:03:07 +0000 Subject: [PATCH] moan about and then delete empty message files --- Changes | 2 ++ perl/DXMsg.pm | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 813b28a0..cb438c68 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +25Aug00======================================================================= +1. moan about and then delete empty message files 24Aug00======================================================================= 1. Removed WWV command so that users can't interfere (read mess up) the automatic feeds which come from various places on the net. diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 5c990177..879775f3 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -512,6 +512,11 @@ sub read_msg_header } $size = -s $fn; $line = <$file>; # first line + if ($size == 0 || !$line) { + dbg('err', "Empty $fn $!"); + Log('err', "Empty $fn $!"); + return undef; + } chomp $line; $size -= length $line; if (! $line =~ /^===/o) { @@ -758,7 +763,12 @@ sub init next unless /^m\d+$/o; $ref = read_msg_header("$msgdir/$_"); - next unless $ref; + unless ($ref) { + dbg('err', "Deleting $_"); + Log('err', "Deleting $_"); + unlink "$msgdir/$_"; + next; + } # delete any messages to 'badmsg.pl' places if (grep $ref->{to} eq $_, @badmsg) { -- 2.43.0