projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c782375
)
fix problems with empty/corrupt filters
author
minima
<minima>
Mon, 9 Oct 2006 15:01:40 +0000
(15:01 +0000)
committer
minima
<minima>
Mon, 9 Oct 2006 15:01:40 +0000
(15:01 +0000)
Changes
patch
|
blob
|
history
perl/Filter.pm
patch
|
blob
|
history
diff --git
a/Changes
b/Changes
index 9e9106dc68990ea59c01f5134165cfcfcf7a0fb7..00e5fb9c8dac74cedf1de26810b2772b773c8588 100644
(file)
--- 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=======================================================================
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 a2f5ce46a7bac5f070e8531eaef59389e0f28b07..3009883b66f3a967665b46cc09e4b8310f5ff354 100644
(file)
--- 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;
$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;
if ($in) {
$newin = new('Filter::Old', $sort, $call, $flag);
$newin->{filter} = $in;
- } els
e
{
+ } els
if (ref $newin && $newin->can('getfilkeys'))
{
my $filter;
my $key;
foreach $key ($newin->getfilkeys) {
$newin->compile($key, 'reject');
$newin->compile($key, 'accept');
}
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;
}
}
return $newin;
}