summaryrefslogtreecommitdiff
path: root/src/os
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/os
parent860c270c73048b4930ac8cbebcd60be746eb9782 (diff)
downloadopenttd-dd138fc460dcbab37452e90ff070a31516994aa2.tar.xz
Codechange: Stringify config file paths.
Diffstat (limited to 'src/os')
-rw-r--r--src/os/windows/crashlog_win.cpp2
-rw-r--r--src/os/windows/win32.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/os/windows/crashlog_win.cpp b/src/os/windows/crashlog_win.cpp
index 7a1a524aa..c96c4cf7c 100644
--- a/src/os/windows/crashlog_win.cpp
+++ b/src/os/windows/crashlog_win.cpp
@@ -499,7 +499,7 @@ char *CrashLogWindows::AppendDecodedStacktrace(char *buffer, const char *last) c
CONST PMINIDUMP_CALLBACK_INFORMATION);
MiniDumpWriteDump_t funcMiniDumpWriteDump = (MiniDumpWriteDump_t)GetProcAddress(dbghelp, "MiniDumpWriteDump");
if (funcMiniDumpWriteDump != nullptr) {
- seprintf(filename, filename_last, "%scrash.dmp", _personal_dir);
+ seprintf(filename, filename_last, "%scrash.dmp", _personal_dir.c_str());
HANDLE file = CreateFile(OTTD2FS(filename), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, 0);
HANDLE proc = GetCurrentProcess();
DWORD procid = GetCurrentProcessId();
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;