mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-20 17:51:02 +00:00
Use XDG Base Directories on *nix
See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
This commit is contained in:
parent
e55753e626
commit
14ba5b82c6
1 changed files with 15 additions and 1 deletions
|
@ -80,8 +80,22 @@ bool Sys_GetPath(sysPath_t type, idStr &path) {
|
|||
return true;
|
||||
|
||||
case PATH_CONFIG:
|
||||
s = getenv("XDG_CONFIG_HOME");
|
||||
if (s)
|
||||
idStr::snPrintf(buf, sizeof(buf), "%s/dhewm3", s);
|
||||
else
|
||||
idStr::snPrintf(buf, sizeof(buf), "%s/.config/dhewm3", getenv("HOME"));
|
||||
|
||||
path = buf;
|
||||
return true;
|
||||
|
||||
case PATH_SAVE:
|
||||
idStr::snPrintf(buf, sizeof(buf), "%s/.doom3", getenv("HOME"));
|
||||
s = getenv("XDG_DATA_HOME");
|
||||
if (s)
|
||||
idStr::snPrintf(buf, sizeof(buf), "%s/dhewm3", s);
|
||||
else
|
||||
idStr::snPrintf(buf, sizeof(buf), "%s/.local/share/dhewm3", getenv("HOME"));
|
||||
|
||||
path = buf;
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue