From 3a716d93b41d26b9404c8c7064cbd73aaa6419d8 Mon Sep 17 00:00:00 2001 From: sago007 Date: Fri, 30 Dec 2016 18:24:12 +0100 Subject: [PATCH] Now creates XDG_DATA_HOME if it is missing. This fixes all known problems. --- code/sys/sys_unix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index aca2154d..f306773d 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -68,6 +68,7 @@ static void Sys_ConcatXdgHomepathName(char* dest, size_t n) { /** * Assignes a buffer with the value of the Xdg home. * 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. * @param dest Buffer to place the value into * @param n Size of buffer @@ -77,12 +78,14 @@ static void Sys_SetXdgDataHomePath(char* dest, size_t n) { dest[0] = '\0'; if (xdgDataPath) { Com_sprintf(dest, n, "%s/", xdgDataPath); + FS_CreatePath(dest); Sys_ConcatXdgHomepathName(dest, n); return; } const char* homeFolder = getHome(); if (homeFolder) { Com_sprintf(dest, n, "%s/.local/share/", homeFolder); + FS_CreatePath(dest); Sys_ConcatXdgHomepathName(dest, n); } }