Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
Armagetron Advanced
Armagetron Advanced
Commits
2e10e357
Commit
2e10e357
authored
Dec 24, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/tools/tDirectories.cpp
View file @
2e10e357
...
...
@@ -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"
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment