diff --git a/src/duckstation-nogui/nogui_host.cpp b/src/duckstation-nogui/nogui_host.cpp index 8e2778ed1..15ce8ae5f 100644 --- a/src/duckstation-nogui/nogui_host.cpp +++ b/src/duckstation-nogui/nogui_host.cpp @@ -147,7 +147,7 @@ bool NoGUIHost::ShouldUsePortableMode() void NoGUIHost::SetAppRoot() { - std::string program_path(FileSystem::GetProgramPath()); + const std::string program_path = FileSystem::GetProgramPath(); Log_InfoPrintf("Program Path: %s", program_path.c_str()); EmuFolders::AppRoot = Path::Canonicalize(Path::GetDirectory(program_path)); @@ -190,7 +190,7 @@ void NoGUIHost::SetDataDirectory() const char* xdg_config_home = getenv("XDG_CONFIG_HOME"); if (xdg_config_home && Path::IsAbsolute(xdg_config_home)) { - EmuFolders::DataRoot = Path::Combine(xdg_config_home, "duckstation"); + EmuFolders::DataRoot = Path::RealPath(Path::Combine(xdg_config_home, "duckstation")); } else { @@ -203,14 +203,14 @@ void NoGUIHost::SetDataDirectory() const std::string share_dir(Path::Combine(local_dir, "share")); FileSystem::EnsureDirectoryExists(local_dir.c_str(), false); FileSystem::EnsureDirectoryExists(share_dir.c_str(), false); - EmuFolders::DataRoot = Path::Combine(share_dir, "duckstation"); + EmuFolders::DataRoot = Path::RealPath(Path::Combine(share_dir, "duckstation")); } } #elif defined(__APPLE__) static constexpr char MAC_DATA_DIR[] = "Library/Application Support/DuckStation"; const char* home_dir = getenv("HOME"); if (home_dir) - EmuFolders::DataRoot = Path::Combine(home_dir, MAC_DATA_DIR); + EmuFolders::DataRoot = Path::RealPath(Path::Combine(home_dir, MAC_DATA_DIR)); #endif // make sure it exists diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index b7977cb60..9a52689c8 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -252,7 +252,7 @@ bool QtHost::ShouldUsePortableMode() void QtHost::SetAppRoot() { - std::string program_path(FileSystem::GetProgramPath()); + const std::string program_path = FileSystem::GetProgramPath(); Log_InfoPrintf("Program Path: %s", program_path.c_str()); EmuFolders::AppRoot = Path::Canonicalize(Path::GetDirectory(program_path)); @@ -295,7 +295,7 @@ void QtHost::SetDataDirectory() const char* xdg_config_home = getenv("XDG_CONFIG_HOME"); if (xdg_config_home && Path::IsAbsolute(xdg_config_home)) { - EmuFolders::DataRoot = Path::Combine(xdg_config_home, "duckstation"); + EmuFolders::DataRoot = Path::RealPath(Path::Combine(xdg_config_home, "duckstation")); } else { @@ -308,14 +308,14 @@ void QtHost::SetDataDirectory() const std::string share_dir(Path::Combine(local_dir, "share")); FileSystem::EnsureDirectoryExists(local_dir.c_str(), false); FileSystem::EnsureDirectoryExists(share_dir.c_str(), false); - EmuFolders::DataRoot = Path::Combine(share_dir, "duckstation"); + EmuFolders::DataRoot = Path::RealPath(Path::Combine(share_dir, "duckstation")); } } #elif defined(__APPLE__) static constexpr char MAC_DATA_DIR[] = "Library/Application Support/DuckStation"; const char* home_dir = getenv("HOME"); if (home_dir) - EmuFolders::DataRoot = Path::Combine(home_dir, MAC_DATA_DIR); + EmuFolders::DataRoot = Path::RealPath(Path::Combine(home_dir, MAC_DATA_DIR)); #endif // make sure it exists