]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
avoid creating an empty config.cfg in the basedir folder unless doing
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 May 2011 03:44:49 +0000 (03:44 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 May 2011 03:44:49 +0000 (03:44 +0000)
the historical compatibility mode (only for id1 on Windows)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11105 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index 80916b0f8f323de03f006bac22890b63e4a77cf8..b678a268f6456c71e6c99ce34ebc93ad1f6f3cda 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1875,6 +1875,12 @@ int FS_ChooseUserDir(userdirmode_t userdirmode, char *userdir, size_t userdirsiz
        }
 #endif
 
+
+#ifdef WIN32
+       // historical behavior...
+       if (userdirmode == USERDIRMODE_NOHOME && strcmp(gamedirname1, "id1"))
+               return 0; // don't bother checking if the basedir folder is writable, it's annoying...  unless it is Quake on Windows where NOHOME is the default preferred and we have to check for an error case
+#endif
        // see if we can write to this path (note: won't create path)
 #if _MSC_VER >= 1400
        _sopen_s(&fd, va("%s%s/config.cfg", userdir, gamedirname1), O_WRONLY | O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE); // note: no O_TRUNC here!