From 6d1914c53b38126850954f8a6998f69ae20d81e2 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Tue, 28 Mar 2023 05:54:33 +0200 Subject: test --- source/kit/file.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/kit/file.c b/source/kit/file.c index 6edaee9..f767851 100644 --- a/source/kit/file.c +++ b/source/kit/file.c @@ -146,18 +146,23 @@ kit_string_t kit_path_cache(kit_allocator_t alloc) { cache = kit_get_env_("LOCALAPPDATA", alloc); if (cache.size != 0) return cache; + DA_DESTROY(cache); #endif + cache = kit_get_env_("XDG_CACHE_HOME", alloc); + if (cache.size != 0) + return cache; + DA_DESTROY(cache); + + user = kit_path_user(alloc); + cache = #ifdef __APPLE__ - user = kit_path_user(alloc); - cache = kit_path_join(WRAP_STR(user), - SZ("Library" PATH_DELIM "Caches"), alloc); - DA_DESTROY(user); + kit_path_join(WRAP_STR(user), SZ("Library" PATH_DELIM "Caches"), + alloc); #else - user = kit_path_user(alloc); - cache = kit_path_join(WRAP_STR(user), SZ(".cache"), alloc); - DA_DESTROY(user); + kit_path_join(WRAP_STR(user), SZ(".cache"), alloc); #endif + DA_DESTROY(user); return cache; } -- cgit v1.2.3