[cvs] bogofilter/src bogoconfig.c,1.22,1.23 bogoconfig.h,1.6,1.7 bogolexer.c,1.13,1.14 configfile.c,
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2003-03-04 21:21:49
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1:/tmp/cvs-serv21454 Modified Files: bogoconfig.c bogoconfig.h bogolexer.c configfile.c main.c Log Message: Rework initialization to ensure charset_table is initialized. Index: bogoconfig.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogoconfig.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- bogoconfig.c 4 Mar 2003 04:08:32 -0000 1.22 +++ bogoconfig.c 4 Mar 2003 21:21:40 -0000 1.23 @@ -152,10 +152,10 @@ { NULL, CP_NONE, { (void *) NULL } }, }; -void process_args_and_config_file(int argc, char **argv) +void process_args_and_config_file(int argc, char **argv, bool warn_on_error) { process_args(argc, argv, 1); - process_config_files(!quiet); + process_config_files(warn_on_error); process_args(argc, argv, 2); if (!twostate && !threestate) { @@ -172,6 +172,11 @@ if (setup_wordlists(directory) != 0) exit(2); } + + stats_prefix= stats_in_header ? "\t" : "# "; + + if (DEBUG_CONFIG(0)) + fprintf(dbgout, "stats_prefix: '%s'\n", stats_prefix); return; } Index: bogoconfig.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogoconfig.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- bogoconfig.h 2 Mar 2003 00:38:22 -0000 1.6 +++ bogoconfig.h 4 Mar 2003 21:21:41 -0000 1.7 @@ -20,6 +20,6 @@ extern const char *user_config_file; extern void query_config(void); -extern void process_args_and_config_file(int argc, char **argv); +extern void process_args_and_config_file(int argc, char **argv, bool warn_on_error); #endif Index: bogolexer.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogolexer.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- bogolexer.c 4 Mar 2003 04:08:33 -0000 1.13 +++ bogolexer.c 4 Mar 2003 21:21:41 -0000 1.14 @@ -163,8 +163,8 @@ int count=0; process_args(argc, argv); - process_config_files(false); + init_charset_table(charset_default, true); textblocks = textblock_init(); Index: configfile.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/configfile.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- configfile.c 4 Mar 2003 04:09:34 -0000 1.11 +++ configfile.c 4 Mar 2003 21:21:41 -0000 1.12 @@ -259,12 +259,5 @@ !read_config_file(user_config_file, true, warn_on_error))) return false; - stats_prefix= stats_in_header ? "\t" : "# "; - - if (DEBUG_CONFIG(0)) - fprintf(dbgout, "stats_prefix: '%s'\n", stats_prefix); - - init_charset_table(charset_default, true); - return true; } Index: main.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- main.c 4 Mar 2003 04:09:34 -0000 1.14 +++ main.c 4 Mar 2003 21:21:41 -0000 1.15 @@ -30,6 +30,7 @@ #include "lexer.h" #include "bogofilter.h" #include "bogoconfig.h" +#include "charset.h" #include "fgetsl.h" #include "format.h" #include "register.h" @@ -66,7 +67,8 @@ int exitcode = 0; FILE *out; - process_args_and_config_file(argc, argv); + process_args_and_config_file(argc, argv, true); + init_charset_table(charset_default, true); /* open all wordlists */ open_wordlists((run_type & (RUN_NORMAL | RUN_UPDATE)) ? DB_READ : DB_WRITE); |