summaryrefslogtreecommitdiffstats
path: root/src/common/fs/path_util.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-12-17 20:25:42 +0100
committerLiam <byteslice@airmail.cc>2023-12-17 20:25:42 +0100
commit09e8fb75ce0b16acc3fa21379c4b3e69d43c520b (patch)
treed6771c87088db094492daf2ed39829cf5efc5873 /src/common/fs/path_util.cpp
parentMerge pull request #12378 from liamwhite/offsetof (diff)
downloadyuzu-09e8fb75ce0b16acc3fa21379c4b3e69d43c520b.tar
yuzu-09e8fb75ce0b16acc3fa21379c4b3e69d43c520b.tar.gz
yuzu-09e8fb75ce0b16acc3fa21379c4b3e69d43c520b.tar.bz2
yuzu-09e8fb75ce0b16acc3fa21379c4b3e69d43c520b.tar.lz
yuzu-09e8fb75ce0b16acc3fa21379c4b3e69d43c520b.tar.xz
yuzu-09e8fb75ce0b16acc3fa21379c4b3e69d43c520b.tar.zst
yuzu-09e8fb75ce0b16acc3fa21379c4b3e69d43c520b.zip
Diffstat (limited to 'src/common/fs/path_util.cpp')
-rw-r--r--src/common/fs/path_util.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index d2f50432a..4f69db6f5 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -418,9 +418,9 @@ std::string SanitizePath(std::string_view path_, DirectorySeparator directory_se
return std::string(RemoveTrailingSlash(path));
}
-std::string_view GetParentPath(std::string_view path) {
+std::string GetParentPath(std::string_view path) {
if (path.empty()) {
- return path;
+ return std::string(path);
}
#ifdef ANDROID
@@ -439,7 +439,7 @@ std::string_view GetParentPath(std::string_view path) {
name_index = std::max(name_bck_index, name_fwd_index);
}
- return path.substr(0, name_index);
+ return std::string(path.substr(0, name_index));
}
std::string_view GetPathWithoutTop(std::string_view path) {