From: minima Date: Mon, 9 Oct 2006 15:01:40 +0000 (+0000) Subject: fix problems with empty/corrupt filters X-Git-Tag: 1.53~21 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a6627ef7afbee6ab015d9f8b75e96cd59809bb59;p=spider.git fix problems with empty/corrupt filters --- diff --git a/Changes b/Changes index 9e9106dc..00e5fb9c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +09Oct06======================================================================= +1. fix problems with bad filters pointed by Thomas DL3SBB. 27Jul06======================================================================= 1. merge in official issue version of wpxloc.raw (with one change: 4U1V). 26Jul06======================================================================= diff --git a/perl/Filter.pm b/perl/Filter.pm index a2f5ce46..3009883b 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -116,17 +116,25 @@ sub read_in $in = undef; my $s = readfilestr($fn); my $newin = eval $s; - dbg($@) if $@; + if ($@) { + dbg($@); + unlink($fn); + return undef; + } if ($in) { $newin = new('Filter::Old', $sort, $call, $flag); $newin->{filter} = $in; - } else { + } elsif (ref $newin && $newin->can('getfilkeys')) { my $filter; my $key; foreach $key ($newin->getfilkeys) { $newin->compile($key, 'reject'); $newin->compile($key, 'accept'); } + } else { + # error on reading file, delete and exit + unlink($fn); + return undef; } return $newin; }