[cvs] bogofilter/src bogoreader.c,1.41,1.42 wordhash.c,1.20,1.21
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2003-10-16 15:43:07
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1:/tmp/cvs-serv4491 Modified Files: bogoreader.c wordhash.c Log Message: Fixes for msg-count files. Index: bogoreader.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogoreader.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- bogoreader.c 14 Oct 2003 22:35:49 -0000 1.41 +++ bogoreader.c 16 Oct 2003 15:40:01 -0000 1.42 @@ -78,7 +78,7 @@ static void bogoreader_close(void); -typedef enum { MBOX, RMAIL, ANT } mbox_t; +typedef enum { MBOX, MC, RMAIL, ANT } mbox_t; typedef struct { const char *sep; @@ -88,9 +88,10 @@ } sep_2_box_t; sep_2_box_t sep_2_box[] = { - { "From ", 5, MBOX, mailbox_getline }, - { "#! rmail", 8, RMAIL, rmail_getline }, - { "MAIL FROM:", 10, ANT, ant_getline } /* RISC-OS only */ + { "From ", 5, MBOX, mailbox_getline }, + { "\".MSG_COUNT\"", 12, MC, mailbox_getline }, /* msg-count */ + { "#! rmail", 8, RMAIL, rmail_getline }, + { "MAIL FROM:", 10, ANT, ant_getline } /* RISC-OS only */ }; ssize_t seplen = 0; Index: wordhash.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/wordhash.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- wordhash.c 14 Oct 2003 20:07:05 -0000 1.20 +++ wordhash.c 16 Oct 2003 15:40:02 -0000 1.21 @@ -391,7 +391,13 @@ count = 0; for(node = wordhash_first(wh); node != NULL; node = wordhash_next(wh)) { - wordprop_t *wp = wordhash_insert(db, node->key, sizeof(wordprop_t), NULL); + wordprop_t *wp; + if (!msg_count_file) + wp = wordhash_insert(db, node->key, sizeof(wordprop_t), NULL); + else { + wp = xcalloc(1, sizeof(wordprop_t)); + memcpy(wp, node->buf, sizeof(wordprop_t)); + } props[count].buf = wp; order[count] = &props[count]; count += 1; |