View | Details | Raw Unified | Return to bug 45587
Collapse All | Expand All

(-)/root/bogofilter/Makefile (-1 / +1 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	bogofilter
8
PORTNAME=	bogofilter
9
PORTVERSION=	0.8.0
9
PORTVERSION=	0.8.0
10
PORTREVISION=	1
10
PORTREVISION=	2
11
CATEGORIES=	mail
11
CATEGORIES=	mail
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
(-)/root/bogofilter/files/patch-z-stats (+62 lines)
Line 0 Link Here
1
diff -ur /root/bogofilter/work/bogofilter-0.8.0/bogofilter.c bf/bogofilter.c
2
--- /root/bogofilter/work/bogofilter-0.8.0/bogofilter.c	Thu Nov  7 07:05:58 2002
3
+++ bf/bogofilter.c	Fri Nov 22 12:51:33 2002
4
@@ -255,10 +255,14 @@
5
 
6
 int compare_extrema(const void *id1, const void *id2)
7
 { 
8
+    double d;
9
     const discrim_t *d1 = id1;
10
     const discrim_t *d2 = id2;
11
-    return ( (d1->prob > d2->prob) ||
12
-	     ((d1->prob == d2->prob) && (strcmp(d1->key, d2->key) > 0)));
13
+    d = d2->prob - d1->prob;
14
+    if (fabs(d) < EPS) return strcmp(d1->key, d2->key);
15
+    if (d1->prob > d2->prob) return 1;
16
+    if (d1->prob < d2->prob) return -1;
17
+    return 0;
18
 }
19
 
20
 void init_bogostats(bogostat_t *bogostats)
21
diff -ur /root/bogofilter/work/bogofilter-0.8.0/common.h bf/common.h
22
--- /root/bogofilter/work/bogofilter-0.8.0/common.h	Mon Oct 28 03:46:17 2002
23
+++ bf/common.h	Fri Nov 22 12:53:23 2002
24
@@ -9,6 +9,10 @@
25
 #include <sys/param.h>
26
 #endif
27
 
28
+#include <float.h>
29
+#define EPS (100.0 * DBL_EPSILON)
30
+
31
+
32
 #include "debug.h"
33
 
34
 #define GOODFILE	"goodlist.db"
35
Only in bf/: cscope.out
36
diff -ur /root/bogofilter/work/bogofilter-0.8.0/rstats.c bf/rstats.c
37
--- /root/bogofilter/work/bogofilter-0.8.0/rstats.c	Wed Nov  6 11:45:03 2002
38
+++ bf/rstats.c	Fri Nov 22 12:52:12 2002
39
@@ -84,10 +84,14 @@
40
 
41
 int compare_rstats_t(const void *ir1, const void *ir2)
42
 { 
43
+    double d;
44
     const rstats_t *r1 = *(rstats_t **)ir1;
45
     const rstats_t *r2 = *(rstats_t **)ir2;
46
-    return ( (r1->prob > r2->prob) ||
47
-	     ((r1->prob == r2->prob) && (strcmp(r1->token, r2->token) > 0)));
48
+    d = r1->prob - r2->prob;
49
+    if (fabs(d) < EPS) return strcmp(r1->token, r2->token);
50
+    if (r1->prob > r2->prob) return 1;
51
+    if (r1->prob < r2->prob) return -1;
52
+    return 0;
53
 }
54
 
55
 #define	INTERVALS	10
56
diff -ur /root/bogofilter/work/bogofilter-0.8.0/version.h bf/version.h
57
--- /root/bogofilter/work/bogofilter-0.8.0/version.h	Fri Nov 22 12:55:52 2002
58
+++ bf/version.h	Fri Nov 22 12:55:13 2002
59
@@ -1,2 +1,2 @@
60
 #undef  VERSION
61
-#define VERSION "0.8.0.1"
62
+#define VERSION "0.8.0.freebsd2"

Return to bug 45587