Core: Obey the XDG basedir specification for environment variables
Emmanuel Gil Peyrot linkmauve@linkmauve.fr
Sun, 07 Aug 2016 00:05:06 +0100
1 files changed,
6 insertions(+),
0 deletions(-)
jump to
M
src/core/config.c
→
src/core/config.c
@@ -227,6 +227,12 @@ portable->close(portable);
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);