From: Holger Schemel Date: Wed, 14 Mar 2018 18:41:20 +0000 (+0100) Subject: fixed bug with deriving game data directory from default 'setup.conf' X-Git-Tag: 4.1.0.0~16 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1dce7f7ee43baff38fdf09b8a7480de1cab662ff;p=rocksndiamonds.git fixed bug with deriving game data directory from default 'setup.conf' --- diff --git a/src/main.c b/src/main.c index 622b022c..75818dfc 100644 --- a/src/main.c +++ b/src/main.c @@ -7688,10 +7688,14 @@ static void InitProgramConfig(char *command_filename) if (fileExists(config_filename)) { // if program config file exists, derive Unix user data directory from it - userdata_basename = getBaseName(config_filename); + // (but only if the program config file is not generic "setup.conf" file) + if (!strEqual(getBaseNamePtr(config_filename), SETUP_FILENAME)) + { + userdata_basename = getBaseName(config_filename); - if (strSuffix(userdata_basename, ".conf")) - userdata_basename[strlen(userdata_basename) - 5] = '\0'; + if (strSuffix(userdata_basename, ".conf")) + userdata_basename[strlen(userdata_basename) - 5] = '\0'; + } LoadSetupFromFilename(config_filename); }