summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-12-06 21:11:42 +0100
committerMichael Lutz <michi@icosahedron.de>2020-12-27 13:19:25 +0100
commitdd138fc460dcbab37452e90ff070a31516994aa2 (patch)
tree170edd04094e997abe891858a8e4753071983fee /src/openttd.cpp
parent860c270c73048b4930ac8cbebcd60be746eb9782 (diff)
downloadopenttd-dd138fc460dcbab37452e90ff070a31516994aa2.tar.xz
Codechange: Stringify config file paths.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 89cc15c35..2409e8e4e 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -88,7 +88,7 @@ bool HandleBootstrap();
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
extern void ShowOSErrorBox(const char *buf, bool system);
-extern char *_config_file;
+extern std::string _config_file;
bool _save_config = false;
@@ -316,8 +316,6 @@ static void ShutdownGame()
/* Uninitialize variables that are allocated dynamically */
GamelogReset();
- free(_config_file);
-
LinkGraphSchedule::Clear();
PoolBase::Clean(PT_ALL);
@@ -566,7 +564,6 @@ int openttd_main(int argc, char *argv[])
_game_mode = GM_MENU;
_switch_mode = SM_MENU;
- _config_file = nullptr;
GetOptData mgo(argc - 1, argv + 1, _options);
int ret = 0;
@@ -672,7 +669,7 @@ int openttd_main(int argc, char *argv[])
return ret;
}
case 'G': scanner->generation_seed = strtoul(mgo.opt, nullptr, 10); break;
- case 'c': free(_config_file); _config_file = stredup(mgo.opt); break;
+ case 'c': _config_file = mgo.opt; break;
case 'x': scanner->save_config = false; break;
case 'h':
i = -2; // Force printing of help.