[cvs] bogofilter/src paths.c,1.29,1.30 bogoutil.c,1.203,1.204
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: David R. <re...@us...> - 2005-03-27 20:34:07
|
Update of /cvsroot/bogofilter/bogofilter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv963 Modified Files: paths.c bogoutil.c Log Message: Fix directory/file issue. Index: bogoutil.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/bogoutil.c,v retrieving revision 1.203 retrieving revision 1.204 diff -u -d -r1.203 -r1.204 --- bogoutil.c 27 Mar 2005 14:17:30 -0000 1.203 +++ bogoutil.c 27 Mar 2005 20:33:55 -0000 1.204 @@ -836,14 +836,17 @@ case M_PAGESIZE: { u_int32_t s; - ds_minit(bogohome, ds_file); - s = ds_pagesize(bogohome, ds_file); + char *f; + f = get_file_from_path(ds_file); + ds_minit(bogohome, f); + s = ds_pagesize(bogohome, f); if (s == 0xffffffff) fprintf(stderr, "%s: error getting page size.\n", ds_file); else if (s == 0) printf("UNKNOWN\n"); else printf("%lu\n", (unsigned long)s); + xfree(f); } break; case M_DUMP: Index: paths.c =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/src/paths.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- paths.c 14 Jan 2005 04:43:44 -0000 1.29 +++ paths.c 27 Mar 2005 20:33:55 -0000 1.30 @@ -166,6 +166,18 @@ return dir; } +char *get_file_from_path(const char *path) +{ + char *file; + + file = strrchr(path, DIRSEP_C); + if (file == NULL) + file = xstrdup(path); + else + file = xstrdup(file + 1); + return file; +} + char *get_directory_from_path(const char *path) { char *dir = xstrdup(path); |