mirror of https://github.com/OpenTTD/OpenTTD
Codechange: to create or not to create a folder, that is the question
This was just weird. With XDG _personal_dir was created already, but later on it was checked if it was different from config_dir, and the creation was skipped. All this checking and validation makes my head spin .. let's make it a bit more simple.pull/8375/head
parent
c66bd18a10
commit
4e12aac9c0
|
@ -1234,7 +1234,6 @@ void DeterminePaths(const char *exe)
|
||||||
/* We are using the XDG configuration home for the config file,
|
/* We are using the XDG configuration home for the config file,
|
||||||
* then store the rest in the XDG data home folder. */
|
* then store the rest in the XDG data home folder. */
|
||||||
_personal_dir = _searchpaths[SP_PERSONAL_DIR_XDG];
|
_personal_dir = _searchpaths[SP_PERSONAL_DIR_XDG];
|
||||||
FioCreateDirectory(_personal_dir);
|
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -1242,9 +1241,9 @@ void DeterminePaths(const char *exe)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make the necessary folders */
|
/* Make the necessary folders */
|
||||||
#if defined(WITH_PERSONAL_DIR)
|
|
||||||
FioCreateDirectory(config_dir);
|
FioCreateDirectory(config_dir);
|
||||||
if (config_dir != _personal_dir) FioCreateDirectory(_personal_dir);
|
#if defined(WITH_PERSONAL_DIR)
|
||||||
|
FioCreateDirectory(_personal_dir);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEBUG(misc, 3, "%s found as personal directory", _personal_dir);
|
DEBUG(misc, 3, "%s found as personal directory", _personal_dir);
|
||||||
|
|
Loading…
Reference in New Issue