diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index e6248b07..aca2154d 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -150,6 +150,14 @@ static void CreateXDGPathAndMisc( void ) { Com_Printf("Failed to move \"%s\" to \"%s\". Error code: %d. Non fatal.", homeClassic, homeXdg, errCode); } } + if (!Sys_IsDir(homeXdg) && Sys_IsDir(homeClassic)) { + //Home classic does still exist and home Xdg does not. This means that the rename above must have failed. + //Link it istead + int errCode = symlink(homeClassic, homeXdg); + if (errCode) { + Com_Printf("Failed to create symbolic link \"%s\". Error code: %d. This is quite bad.", homeXdg, errCode); + } + } if (!Sys_IsDir(homeXdg)) { int errCode = Sys_Mkdir(homeXdg); if (errCode) { @@ -162,12 +170,6 @@ static void CreateXDGPathAndMisc( void ) { Com_Printf("Failed to create symbolic link \"%s\". Error code: %d. This is quite bad.", homeClassic, errCode); } } - if (!Sys_IsDir(homeXdg) && Sys_IsDir(homeClassic)) { - int errCode = symlink(homeClassic, homeXdg); - if (errCode) { - Com_Printf("Failed to create symbolic link \"%s\". Error code: %d. This is quite bad.", homeXdg, errCode); - } - } } /* @@ -193,12 +195,6 @@ const char *Sys_DefaultHomePath(void) else Q_strcat(homePath, sizeof(homePath), HOMEPATH_NAME_MACOSX); #else -#if 0 - if(com_homepath->string[0]) - Q_strcat(homePath, sizeof(homePath), com_homepath->string); - else - Q_strcat(homePath, sizeof(homePath), HOMEPATH_NAME_UNIX); -#endif CreateXDGPathAndMisc(); Com_sprintf(homePath, sizeof(homePath), "%s", homeXdg); #endif