1
0
Fork 0

Fix #12945: Relative paths passed to -c were not made absolute

pull/12946/head
Jonathan G Rennison 2024-09-17 22:23:06 +01:00
parent a241ef8da0
commit 41473bfc8a
1 changed files with 3 additions and 3 deletions

View File

@ -822,11 +822,11 @@ void DetermineBasePaths(const char *exe)
if (end == std::string::npos) {
/* _config_file is not in a folder, so use current directory. */
tmp = cwd;
AppendPathSeparator(tmp);
_searchpaths[SP_WORKING_DIR] = tmp;
} else {
_searchpaths[SP_WORKING_DIR] = _config_file.substr(0, end + 1);
tmp = FS2OTTD(std::filesystem::weakly_canonical(std::filesystem::path(OTTD2FS(_config_file))).parent_path());
}
AppendPathSeparator(tmp);
_searchpaths[SP_WORKING_DIR] = tmp;
}
/* Change the working directory to that one of the executable */