[cvs] bogofilter/src bogoutil.c,1.214,1.215
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: David R. <re...@us...> - 2005-04-24 18:28:46
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25588 Modified Files: bogoutil.c Log Message: Allow file or directory to be specified. Index: bogoutil.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogoutil.c,v retrieving revision 1.214 retrieving revision 1.215 diff -u -d -r1.214 -r1.215 --- bogoutil.c 23 Apr 2005 13:10:30 -0000 1.214 +++ bogoutil.c 24 Apr 2005 18:28:37 -0000 1.215 @@ -33,6 +33,7 @@ #include "longoptions.h" #include "maint.h" #include "msgcounts.h" +#include "mxcat.h" #include "paths.h" #include "prob.h" #include "robx.h" @@ -847,15 +848,22 @@ } bfp = bfpath_create(ds_file); - mode = get_mode(flag); - bfpath_update(bfp); + mode = get_mode(flag); if (!bfpath_check_mode(bfp, mode)) { fprintf(stderr, "Can't open wordlist '%s'\n", bfp->filepath); exit(EX_ERROR); } + if (bfp->isdir && + (bfp->filename == NULL || strcmp(bfp->filename, ".") == 0)) { + const char *filename = mxcat(bfp->dirname, DIRSEP_S, WORDLIST, NULL); + bfpath_free(bfp); + bfp = bfpath_create(filename); + bfpath_update(bfp); + } + switch(flag) { case M_RECOVER: ds_init(bfp); |