summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2020-12-08 23:11:47 +0100
committerPatric Stout <github@truebrain.nl>2020-12-13 16:40:56 +0100
commit4e12aac9c0609f7a42d397106d102ad3367598bd (patch)
treebc1b535e43f0f9de146a86ee0c58f04635557383
parentc66bd18a1087d4b34d79faf68afb9ff8fea89be4 (diff)
downloadopenttd-4e12aac9c0609f7a42d397106d102ad3367598bd.tar.xz
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.
-rw-r--r--src/fileio.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index d40ca2136..cc6cb30de 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -1234,7 +1234,6 @@ void DeterminePaths(const char *exe)
/* We are using the XDG configuration home for the config file,
* then store the rest in the XDG data home folder. */
_personal_dir = _searchpaths[SP_PERSONAL_DIR_XDG];
- FioCreateDirectory(_personal_dir);
} else
#endif
{
@@ -1242,9 +1241,9 @@ void DeterminePaths(const char *exe)
}
/* Make the necessary folders */
-#if defined(WITH_PERSONAL_DIR)
FioCreateDirectory(config_dir);
- if (config_dir != _personal_dir) FioCreateDirectory(_personal_dir);
+#if defined(WITH_PERSONAL_DIR)
+ FioCreateDirectory(_personal_dir);
#endif
DEBUG(misc, 3, "%s found as personal directory", _personal_dir);