From 750ec66e97f390a28450dad797a59945e443daa4 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 5 May 2011 03:44:49 +0000 Subject: [PATCH] avoid creating an empty config.cfg in the basedir folder unless doing 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs.c b/fs.c index 80916b0f..b678a268 100644 --- 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! -- 2.39.2