X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=fs.c;h=b678a268f6456c71e6c99ce34ebc93ad1f6f3cda;hp=b5ffaf2acb31762f2ad6e4e04bcd10e5df817c15;hb=72febe336719285ecd4f855454d1e90f7aa99834;hpb=ccb7a250d36552a62dd9abbe9b9fc87853d9cba2 diff --git a/fs.c b/fs.c index b5ffaf2a..b678a268 100644 --- a/fs.c +++ b/fs.c @@ -1364,11 +1364,14 @@ void FS_Rescan (void) // gamedirname1 (typically id1) FS_AddGameHierarchy (gamedirname1); // update the com_modname (used for server info) - strlcpy(com_modname, gamedirname1, sizeof(com_modname)); + if (gamedirname2 && gamedirname2[0]) + strlcpy(com_modname, gamedirname2, sizeof(com_modname)); + else + strlcpy(com_modname, gamedirname1, sizeof(com_modname)); // add the game-specific path, if any // (only used for mission packs and the like, which should set fs_modified) - if (gamedirname2) + if (gamedirname2 && gamedirname2[0]) { fs_modified = true; FS_AddGameHierarchy (gamedirname2); @@ -1872,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!