From 14387fcd913c81d79f3da77353854c0ed2ab3f87 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 4 Nov 2003 04:07:24 +0000 Subject: [PATCH] Synch to Gnus 200311040404. --- lisp/ChangeLog | 5 +++++ lisp/gnus-score.el | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66a0623..9f91ea3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2003-11-04 Katsumi Yamaoka + + * gnus-score.el (gnus-decay-score): Protect against arithmetic + errors. Tiny patch from Norbert Koch . + 2003-10-31 Teodor Zlatanov * spam.el diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index ce255e8..bf5de64 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -2953,13 +2953,15 @@ If ADAPT, return the home adaptive file instead." (defun gnus-decay-score (score) "Decay SCORE according to `gnus-score-decay-constant' and `gnus-score-decay-scale'." - (floor - (- score - (* (if (< score 0) -1 1) - (min (abs score) - (max gnus-score-decay-constant - (* (abs score) - gnus-score-decay-scale))))))) + (condition-case nil + (floor + (- score + (* (if (< score 0) -1 1) + (min (abs score) + (max gnus-score-decay-constant + (* (abs score) + gnus-score-decay-scale)))))) + (arith-error (lsh -1 -1)))) (defun gnus-decay-scores (alist day) "Decay non-permanent scores in ALIST." -- 1.7.10.4