Commit 2e10e357 authored by Manuel Moos's avatar Manuel Moos
Browse files

Add support for XDG_CACHE_HOME, move resource cache there

parent b329e7b6
Pipeline #234260788 passed with stages
in 49 minutes and 22 seconds
......@@ -240,8 +240,12 @@ static tString st_WwwDir(expand_home_c(WWWROOTDIR)); // directory for dynami
static tString st_ResourceDir(expand_home_c(RESOURCE_DIR));
#ifndef AUTORESOURCE_DIR
#ifdef USE_XDG
#define AUTORESOURCE_DIR "${XDG_CACHE_HOME}/" PROGDIR "/resource"
#else
#define AUTORESOURCE_DIR ""
#endif
#endif
static tString st_AutoResourceDir(expand_home_c(AUTORESOURCE_DIR));
#ifndef INCLUDEDRESOURCE_DIR
......@@ -501,6 +505,12 @@ char *eh_getdir(const char *da, size_t *len) {
tString data(xdg_data ? xdg_data : tString(pw->pw_dir) + "/.local/share");
ret = strdup( data );
}
else if (!strcmp(type, "XDG_CACHE_HOME"))
{
char const * xdg_cache = getenv("XDG_CACHE_HOME");
tString data(xdg_cache ? xdg_cache : tString(pw->pw_dir) + "/.cache");
ret = strdup( data );
}
// fall back to default for HOME
if (!strcmp(type, "HOME"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment