Now creates XDG_DATA_HOME if it is missing. This fixes all known problems.
This commit is contained in:
@@ -68,6 +68,7 @@ static void Sys_ConcatXdgHomepathName(char* dest, size_t n) {
|
|||||||
/**
|
/**
|
||||||
* Assignes a buffer with the value of the Xdg home.
|
* Assignes a buffer with the value of the Xdg home.
|
||||||
* Normally: "$HOME/.local/share/openarena"
|
* Normally: "$HOME/.local/share/openarena"
|
||||||
|
* XDG_DATA_HOME will also be recursivly created if it is missing
|
||||||
* If it failes the destination buffer will be the empty string.
|
* If it failes the destination buffer will be the empty string.
|
||||||
* @param dest Buffer to place the value into
|
* @param dest Buffer to place the value into
|
||||||
* @param n Size of buffer
|
* @param n Size of buffer
|
||||||
@@ -77,12 +78,14 @@ static void Sys_SetXdgDataHomePath(char* dest, size_t n) {
|
|||||||
dest[0] = '\0';
|
dest[0] = '\0';
|
||||||
if (xdgDataPath) {
|
if (xdgDataPath) {
|
||||||
Com_sprintf(dest, n, "%s/", xdgDataPath);
|
Com_sprintf(dest, n, "%s/", xdgDataPath);
|
||||||
|
FS_CreatePath(dest);
|
||||||
Sys_ConcatXdgHomepathName(dest, n);
|
Sys_ConcatXdgHomepathName(dest, n);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char* homeFolder = getHome();
|
const char* homeFolder = getHome();
|
||||||
if (homeFolder) {
|
if (homeFolder) {
|
||||||
Com_sprintf(dest, n, "%s/.local/share/", homeFolder);
|
Com_sprintf(dest, n, "%s/.local/share/", homeFolder);
|
||||||
|
FS_CreatePath(dest);
|
||||||
Sys_ConcatXdgHomepathName(dest, n);
|
Sys_ConcatXdgHomepathName(dest, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user