Jon Raphaelson <jonraphael...@gmail.com> writes:

> Hi all,
>
> Attached is a patch to dmenu_path which (if enabled in the config.mk)
> changes the cache file location to be XDG Base Directory Specification
> compliant. After enabling the change, the cache file will live at
> $XDG_CACHE_HOME/dmenu/path.cache (or $HOME/.cache/dmenu/path.cache if
> $XDG_CACHE_HOME is not set), rather than in the home directory at
> ~/.dmenu_cache.
>
> This patch relies on libxdg-basedir [2] being installed.

I actually like the XDG basedir specification, although I expect most on
this list to be in a different camp, but why do you use a library for
retrieving the location of the cache file?  It's a simple matter of
reading environment variables, is it not?

Secondly, your code has a number of errors.  You limit the path to 255
characters, and neglect to null-terminate if it is beyond that.  Also,
the strcat calls may overflow cachepath and cachefile is not
NUL-terminated.

-- 
\  Troels
/\ Henriksen

Reply via email to