diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-10-25 04:51:09 +0200 |
---|---|---|
committer | Charles Lombardo <clombardo169@gmail.com> | 2023-10-30 16:38:10 +0100 |
commit | 585b6e9d46b207a6b48a021ea35636fb8c92b405 (patch) | |
tree | 8909909ba82a90979748d6fa2bd875aa47cea050 /src/common/fs/path_util.cpp | |
parent | android: Refactor game metadata collection to new file (diff) | |
download | yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.gz yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.bz2 yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.lz yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.xz yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.zst yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.zip |
Diffstat (limited to 'src/common/fs/path_util.cpp')
-rw-r--r-- | src/common/fs/path_util.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 0c4c88cde..c3a81f9a9 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp @@ -401,6 +401,16 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se } std::string_view GetParentPath(std::string_view path) { + if (path.empty()) { + return path; + } + +#ifdef ANDROID + if (path[0] != '/') { + std::string path_string{path}; + return FS::Android::GetParentDirectory(path_string); + } +#endif const auto name_bck_index = path.rfind('\\'); const auto name_fwd_index = path.rfind('/'); std::size_t name_index; |