summaryrefslogtreecommitdiff
path: root/src/common/fs/path_util.cpp
diff options
context:
space:
mode:
authorGravatar Franco M2023-11-04 21:28:16 -0300
committerGravatar GitHub2023-11-04 21:28:16 -0300
commit728aca770317b3f86961c8669ba9ae5c68570d3f (patch)
tree29adffcb1d264cc16cacb478a8f6645ef6259b3b /src/common/fs/path_util.cpp
parentWe dont need that (diff)
parentMerge pull request #11952 from liamwhite/opus_stereo_count (diff)
downloadyuzu-728aca770317b3f86961c8669ba9ae5c68570d3f.tar.gz
yuzu-728aca770317b3f86961c8669ba9ae5c68570d3f.tar.xz
yuzu-728aca770317b3f86961c8669ba9ae5c68570d3f.zip
Merge branch 'master' into new-shortcut
Diffstat (limited to 'src/common/fs/path_util.cpp')
-rw-r--r--src/common/fs/path_util.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 0abd81a45..c3a81f9a9 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -119,6 +119,7 @@ public:
119 GenerateYuzuPath(YuzuPath::AmiiboDir, yuzu_path / AMIIBO_DIR); 119 GenerateYuzuPath(YuzuPath::AmiiboDir, yuzu_path / AMIIBO_DIR);
120 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache); 120 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache);
121 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config); 121 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config);
122 GenerateYuzuPath(YuzuPath::CrashDumpsDir, yuzu_path / CRASH_DUMPS_DIR);
122 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); 123 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR);
123 GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); 124 GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR);
124 GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); 125 GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR);
@@ -400,6 +401,16 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se
400} 401}
401 402
402std::string_view GetParentPath(std::string_view path) { 403std::string_view GetParentPath(std::string_view path) {
404 if (path.empty()) {
405 return path;
406 }
407
408#ifdef ANDROID
409 if (path[0] != '/') {
410 std::string path_string{path};
411 return FS::Android::GetParentDirectory(path_string);
412 }
413#endif
403 const auto name_bck_index = path.rfind('\\'); 414 const auto name_bck_index = path.rfind('\\');
404 const auto name_fwd_index = path.rfind('/'); 415 const auto name_fwd_index = path.rfind('/');
405 std::size_t name_index; 416 std::size_t name_index;