diff options
author | Michael Lutz <michi@icosahedron.de> | 2020-12-06 21:11:42 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2020-12-27 13:19:25 +0100 |
commit | dd138fc460dcbab37452e90ff070a31516994aa2 (patch) | |
tree | 170edd04094e997abe891858a8e4753071983fee /src/os/windows/win32.cpp | |
parent | 860c270c73048b4930ac8cbebcd60be746eb9782 (diff) | |
download | openttd-dd138fc460dcbab37452e90ff070a31516994aa2.tar.xz |
Codechange: Stringify config file paths.
Diffstat (limited to 'src/os/windows/win32.cpp')
-rw-r--r-- | src/os/windows/win32.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp index 468234391..c4e400279 100644 --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -451,7 +451,7 @@ char *getcwd(char *buf, size_t size) return buf; } -extern char *_config_file; +extern std::string _config_file; void DetermineBasePaths(const char *exe) { @@ -482,7 +482,7 @@ void DetermineBasePaths(const char *exe) _searchpaths[SP_SHARED_DIR] = nullptr; #endif - if (_config_file == nullptr) { + if (_config_file.empty()) { /* Get the path to working directory of OpenTTD. */ getcwd(tmp, lengthof(tmp)); AppendPathSeparator(tmp, lastof(tmp)); @@ -490,7 +490,7 @@ void DetermineBasePaths(const char *exe) } else { /* Use the folder of the config file as working directory. */ TCHAR config_dir[MAX_PATH]; - _tcsncpy(path, convert_to_fs(_config_file, path, lengthof(path)), lengthof(path)); + _tcsncpy(path, convert_to_fs(_config_file.c_str(), path, lengthof(path)), lengthof(path)); if (!GetFullPathName(path, lengthof(config_dir), config_dir, nullptr)) { DEBUG(misc, 0, "GetFullPathName failed (%lu)\n", GetLastError()); _searchpaths[SP_WORKING_DIR] = nullptr; |