Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv28038/Classifier
Modified Files:
Bayes.pm
Log Message:
Ensure that the output from history_read_class is consistent if the file CLS file does not exist or is empty; add appropriate test case
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.178
retrieving revision 1.179
diff -C2 -d -r1.178 -r1.179
*** Bayes.pm 31 Jul 2003 16:32:20 -0000 1.178
--- Bayes.pm 1 Aug 2003 00:59:56 -0000 1.179
***************
*** 931,935 ****
my $reclassified = 0;
! my $bucket = "unknown class";
my $usedtobe;
my $magnet = '';
--- 931,935 ----
my $reclassified = 0;
! my $bucket = 'unknown class';
my $usedtobe;
my $magnet = '';
***************
*** 954,959 ****
$self->log_( "Error: " . $self->global_config_( 'msgdir' ) . "$filename: $!" );
! return ( undef, undef, undef, undef );
}
return ( $reclassified, $bucket, $usedtobe, $magnet );
}
--- 954,962 ----
$self->log_( "Error: " . $self->global_config_( 'msgdir' ) . "$filename: $!" );
! return ( undef, $bucket, undef, undef );
}
+
+ $bucket = 'unknown class' if ( !defined( $bucket ) );
+
return ( $reclassified, $bucket, $usedtobe, $magnet );
}
|