paths, esp. ds-print-pagesize

David Relson relson at osagesoftware.com
Sun Mar 27 22:24:39 CEST 2005


Matthias,

Looking at paths.c, I see function get_directory_from_path(), but no
get_file_from_path().  Any reason not to add one?  With it, the 
db-print-pagesize code becomes (roughly):

    case M_PAGESIZE:
    {
        u_int32_t s;
        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);
    }

I'm noticing how many functions are called with directory & filename
parameters and how many different functions we have for working with
paths and how many different places use those functions.  I wonder if
we can do better than that?
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev



More information about the bogofilter-dev mailing list