mirror of https://github.com/mgba-emu/mgba.git
Core: Obey the XDG basedir specification for environment variables
This commit is contained in:
parent
67a09eaa1d
commit
88fc68aaf7
|
@ -227,6 +227,12 @@ void mCoreConfigDirectory(char* out, size_t outLength) {
|
|||
return;
|
||||
}
|
||||
|
||||
char* xdgConfigHome = getenv("XDG_CONFIG_HOME");
|
||||
if (xdgConfigHome && xdgConfigHome[0] == '/') {
|
||||
snprintf(out, outLength, "%s/%s", xdgConfigHome, binaryName);
|
||||
mkdir(out, 0755);
|
||||
return;
|
||||
}
|
||||
char* home = getenv("HOME");
|
||||
snprintf(out, outLength, "%s/.config", home);
|
||||
mkdir(out, 0755);
|
||||
|
|
Loading…
Reference in New Issue