building paths
David Relson
relson at osagesoftware.com
Fri Jan 14 05:09:03 CET 2005
On Fri, 14 Jan 2005 04:06:09 +0100
Matthias Andree wrote:
> David Relson <relson at osagesoftware.com> writes:
>
> > It would be better if the function is declared:
> >
> > char *build_path(const char* dir, const char* file);
>
> This might be a user of the mxcat() function,
> documentation in src/mxcat.h.
As a second step, I'll see if it applies.
> > and the function is responsible for allocating the storage it needs.
> > NULL could be used to indicate a problem, assuming we find a need to
> > check the result.
> >
> > The advantage of doing this is that it centralizes the allocation of
> > "dest" and removes multiple copies of the current allocation code.
> >
> > What do you think?
>
> Good idea, go for it. I have no changes for this area in my pipe or
> workdir.
>
> > Note: if we change this, related function build_wordlist_path will
> > also need to be changed.
>
> Right.
I'm also noticing that the full path to the database is only used when
opening the database and for error messages. Perhaps the real path
could be built in ds_open(), which would be called with "pieces"
(directory, separator, filename). I suspect that there's a gotcha :-<
More information about the bogofilter-dev
mailing list