You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/01/08 02:14:23 UTC

svn commit: rev 6091 - incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin

Author: felicity
Date: Mon Jan  5 08:22:11 2004
New Revision: 6091

Modified:
   incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm
Log:
bug 2827: DB_File is expected to return undef for values that don't exist,
but apparently sometimes it'll return "".


Modified: incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm
==============================================================================
--- incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm	(original)
+++ incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/BayesStore.pm	Mon Jan  5 08:22:11 2004
@@ -1247,8 +1247,10 @@
       $self->{db_toks}->{$NEWEST_TOKEN_AGE_MAGIC_TOKEN} = $atime;
     }
 
+    # Make sure to check for either !defined or "" ...  Apparently
+    # sometimes the DB module doesn't return the value correctly. :(
     my $oldmagic = $self->{db_toks}->{$OLDEST_TOKEN_AGE_MAGIC_TOKEN};
-    if (!defined ($oldmagic) || $atime < $oldmagic) {
+    if (!defined ($oldmagic) || $oldmagic eq "" || $atime < $oldmagic) {
       $self->{db_toks}->{$OLDEST_TOKEN_AGE_MAGIC_TOKEN} = $atime;
     }
   }