From b261d62cc9693894e30a10300d3978d50bfac885 Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 12 Jun 2023 23:44:59 +0200 Subject: [PATCH] Allow "xdg" to be entered to force XDG cache directory even if XDG_CACHE_DIR is not set --- libs/img.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/img.c b/libs/img.c index a7905f4..c85253f 100644 --- a/libs/img.c +++ b/libs/img.c @@ -247,7 +247,7 @@ void loadimagecache(const char *file, int *width, int *height) { // path for cached thumbnail if (!cachedir || !strcmp(cachedir, "default")) { - if (xdg_cache) + if (xdg_cache || !strcmp(cachedir, "xdg")) slen = snprintf(NULL, 0, "%s/thumbnails/%s/%s.png", xdg_cache, dsize, md5)+1; else slen = snprintf(NULL, 0, "%s/.thumbnails/%s/%s.png", home, dsize, md5)+1; @@ -256,7 +256,7 @@ void loadimagecache(const char *file, int *width, int *height) { } if(!(buf = malloc(slen))) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "spmenu: out of memory"); return; }