From: Andrew DeFaria Date: Tue, 23 Jan 2018 21:24:36 +0000 (-0800) Subject: Fixed bug hit_count was not being returned properly X-Git-Url: https://defaria.com/gitweb/?a=commitdiff_plain;h=842a2738bfac772cf226f08a9fa9753377e8a323;p=clearscm.git Fixed bug hit_count was not being returned properly Don't know how this became a problem but I believe it to be fixed now. --- diff --git a/maps/bin/MAPSDB.pm b/maps/bin/MAPSDB.pm index ed0460c..5836e2a 100644 --- a/maps/bin/MAPSDB.pm +++ b/maps/bin/MAPSDB.pm @@ -214,7 +214,7 @@ sub CheckOnList ($$;$) { $update //= 1; my $status = 0; - my ($rule, $hit_count); + my ($rule, $sequence, $hit_count); my $statement = "select pattern, domain, comment, sequence, hit_count from list where userid = '$userid' and type = '$listtype'"; @@ -228,7 +228,7 @@ sub CheckOnList ($$;$) { last if !@row; $hit_count = pop (@row); - my $sequence = pop (@row); + $sequence = pop (@row); my $comment = pop (@row); my $domain = pop (@row); my $pattern = pop (@row); @@ -274,7 +274,7 @@ sub CheckOnList ($$;$) { $sth->finish; - return ($status, $rule, $hit_count); + return ($status, $rule, $sequence, $hit_count); } # CheckOnList sub CleanEmail ($) { diff --git a/maps/bin/add2nulllist.pl b/maps/bin/add2nulllist.pl index 27d694e..b6003c2 100755 --- a/maps/bin/add2nulllist.pl +++ b/maps/bin/add2nulllist.pl @@ -21,10 +21,10 @@ sub GetItems { my @items; - open FILE, $filename + open my $file, '<', $filename or error "Unable to open $filename - $!", 1; - while () { + while (<$file>) { my @fields = split; my %item; @@ -33,11 +33,13 @@ sub GetItems { $item{pattern} = $address[0]; $item{domain} = $address[1]; $item{comment} = $fields[1] ? $fields[1] : ''; - $itme{hit_count} = $fields[2] ? $fields[2] : 0; + $item{hit_count} = $fields[2] ? $fields[2] : 0; push @items, \%item; } # while + close $file; + return @items; } # GetItems @@ -82,6 +84,8 @@ sub Add2List { } # if $nextseq++; } # while + + return; } # Add2List # Main