Bugfix GetFriendlyPath, use in more places

This commit is contained in:
Henrik Rydgård committed 2026-01-29 23:15:32 +01:00
1 parent 1ed2f53385
commit cbcec3e27f
5 files changed
+23 -15

No files matched your search

+5 -5
View File
@@ -189,21 +189,21 @@ std::string GetFriendlyPath(Path path, const Path &rootMatch, std::string_view r
const Path &root = rootMatch.empty() ? g_Config.memStickDirectory : rootMatch;
// Show relative to memstick root if there.
if (path.StartsWith(rootMatch)) {
if (path.StartsWith(root)) {
std::string p;
if (rootMatch.ComputePathTo(path, p)) {
if (root.ComputePathTo(path, p)) {
return join(rootDisplay, p);
}
std::string str = path.ToString();
if (rootMatch.size() < str.length()) {
return join(rootDisplay, str.substr(rootMatch.size()));
if (root.size() < str.length()) {
return join(rootDisplay, str.substr(root.size()));
} else {
return std::string(rootDisplay);
}
}
std::string str = path.ToString();
#if !PPSSPP_PLATFORM(ANDROID) && (PPSSPP_PLATFORM(LINUX) || PPSSPP_PLATFORM(MAC))
std::string str = path.ToString();
char *home = getenv("HOME");
if (home != nullptr && !strncmp(str.c_str(), home, strlen(home))) {
return "~" + str.substr(strlen(home));