HostInterface: Change working directory to user directory at startup

This commit is contained in:
Connor McLaughlin 2020-01-24 14:51:02 +10:00
parent 53428cb55b
commit 2c3a0a6af9
1 changed files with 7 additions and 0 deletions

View File

@ -453,6 +453,13 @@ void HostInterface::SetUserDirectory()
#endif
Log_InfoPrintf("User directory: %s", m_user_directory.c_str());
// Change to the user directory so that all default/relative paths in the config are after this.
if (!m_user_directory.empty())
{
if (!FileSystem::SetWorkingDirectory(m_user_directory.c_str()))
Log_ErrorPrintf("Failed to set working directory to '%s'", m_user_directory.c_str());
}
}
std::string HostInterface::GetUserDirectoryRelativePath(const char* format, ...)