summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-12-10 01:25:00 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-12-10 01:28:11 +0100
commitec8548b414d39bf389ca55154e383ca5574344e7 (patch)
treec92c7d2cbbd1cb5aad1b8ee3ecba654bd657a19a
parentMerge pull request #5179 from ReinUsesLisp/fs-path (diff)
downloadyuzu-ec8548b414d39bf389ca55154e383ca5574344e7.tar
yuzu-ec8548b414d39bf389ca55154e383ca5574344e7.tar.gz
yuzu-ec8548b414d39bf389ca55154e383ca5574344e7.tar.bz2
yuzu-ec8548b414d39bf389ca55154e383ca5574344e7.tar.lz
yuzu-ec8548b414d39bf389ca55154e383ca5574344e7.tar.xz
yuzu-ec8548b414d39bf389ca55154e383ca5574344e7.tar.zst
yuzu-ec8548b414d39bf389ca55154e383ca5574344e7.zip
-rw-r--r--src/common/file_util.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index a286b9341..8e061ff6c 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -136,16 +136,10 @@ bool CreateDirs(const fs::path& path) {
bool CreateFullPath(const fs::path& path) {
LOG_TRACE(Common_Filesystem, "path {}", path);
- // Removes trailing slashes and turns any '\' into '/'
- const auto new_path = SanitizePath(path.string(), DirectorySeparator::ForwardSlash);
-
- if (new_path.rfind('.') == std::string::npos) {
- // The path is a directory
- return CreateDirs(new_path);
+ if (path.has_extension()) {
+ return CreateDirs(path.parent_path());
} else {
- // The path is a file
- // Creates directory preceding the last '/'
- return CreateDirs(new_path.substr(0, new_path.rfind('/')));
+ return CreateDirs(path);
}
}