Re: [dev] [dmenu] Patch for XDG Base Directory specification of dmenu_path

From: Troels Henriksen <athas_AT_sigkill.dk>
Date: Thu, 30 Dec 2010 23:46:28 +0100

Jon Raphaelson <jonraphaelson_AT_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
Received on Thu Dec 30 2010 - 23:46:28 CET

This archive was generated by hypermail 2.2.0 : Thu Dec 30 2010 - 23:48:02 CET