[cvs] bogofilter/src bogoutil.c,1.107,1.108 bogotune.c,1.112,1.113
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <m-...@us...> - 2004-02-24 03:01:09
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27963/src Modified Files: bogoutil.c bogotune.c Log Message: Use set_bogohome() for proper data base initialization. Index: bogoutil.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogoutil.c,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- bogoutil.c 20 Feb 2004 17:05:41 -0000 1.107 +++ bogoutil.c 24 Feb 2004 02:54:55 -0000 1.108 @@ -31,6 +31,7 @@ #include "paths.h" #include "prob.h" #include "robx.h" +#include "set_bogohome.h" #include "swap.h" #include "wordlists.h" #include "xmalloc.h" @@ -77,6 +78,7 @@ token_count = 0; + set_bogohome(ds_file); rc = ds_oper(ds_file, DB_READ, ds_dump_hook, NULL); if (verbose) @@ -108,6 +110,8 @@ unsigned long count[IX_SIZE], date; YYYYMMDD today_save = today; + set_bogohome(ds_file); + ds_init(); dsh = ds_open(CURDIR_S, ds_file, DB_WRITE); @@ -338,11 +342,12 @@ char filepath[PATH_LEN]; word_t *word_robx = word_new((const byte *)ROBX_W, (uint) strlen(ROBX_W)); - + build_wordlist_path(filepath, sizeof(filepath), path); - + run_type = REG_SPAM; + set_bogohome(filepath); ds_init(); dsh = ds_open(CURDIR_S, filepath, DB_WRITE); if (dsh == NULL) @@ -599,14 +604,18 @@ return load_file(ds_file); case M_MAINTAIN: maintain = true; + set_bogohome(ds_file); return maintain_wordlist_file(ds_file); case M_WORD: argc -= optind; argv += optind; + set_bogohome(ds_file); return display_words(ds_file, argc, argv, prob); case M_HIST: + set_bogohome(ds_file); return histogram(ds_file); case M_ROBX: + set_bogohome(ds_file); return get_robx(ds_file); case M_NONE: default: Index: bogotune.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogotune.c,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- bogotune.c 23 Feb 2004 14:53:29 -0000 1.112 +++ bogotune.c 24 Feb 2004 02:54:55 -0000 1.113 @@ -60,6 +60,7 @@ #include "robx.h" #include "rstats.h" #include "score.h" +#include "set_bogohome.h" #include "token.h" #include "tunelist.h" #include "wordhash.h" @@ -899,7 +900,7 @@ return; } - db_cachesize = ceil(sb.st_size / 3.0 / 1024.0 / 1024.0); + db_cachesize = ceil(sb.st_size / (3 * 1024 * 1024)); return; } @@ -1593,6 +1594,7 @@ /* process args and read mailboxes */ process_arglist(argc, argv); + set_bogohome(ds_file); if (ds_file) check_wordlist_path(); |