summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/vfs.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-13 07:43:35 +0200
committerGitHub <noreply@github.com>2018-08-13 07:43:35 +0200
commite67630b51e5f453fea5bc6825e4c1a43d9306cf9 (patch)
tree58148af1f7e3a043c499807d98dad02ef6264cf9 /src/core/file_sys/vfs.cpp
parentMerge pull request #1031 from lioncash/verbosity (diff)
parentvfs: Use sanitized paths within MoveFile() and MoveDirectory() (diff)
downloadyuzu-e67630b51e5f453fea5bc6825e4c1a43d9306cf9.tar
yuzu-e67630b51e5f453fea5bc6825e4c1a43d9306cf9.tar.gz
yuzu-e67630b51e5f453fea5bc6825e4c1a43d9306cf9.tar.bz2
yuzu-e67630b51e5f453fea5bc6825e4c1a43d9306cf9.tar.lz
yuzu-e67630b51e5f453fea5bc6825e4c1a43d9306cf9.tar.xz
yuzu-e67630b51e5f453fea5bc6825e4c1a43d9306cf9.tar.zst
yuzu-e67630b51e5f453fea5bc6825e4c1a43d9306cf9.zip
Diffstat (limited to 'src/core/file_sys/vfs.cpp')
-rw-r--r--src/core/file_sys/vfs.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp
index 24e158962..a5ec50b1a 100644
--- a/src/core/file_sys/vfs.cpp
+++ b/src/core/file_sys/vfs.cpp
@@ -74,15 +74,15 @@ VirtualFile VfsFilesystem::CopyFile(std::string_view old_path_, std::string_view
return new_file;
}
-VirtualFile VfsFilesystem::MoveFile(std::string_view old_path_, std::string_view new_path_) {
- const auto old_path = FileUtil::SanitizePath(old_path_);
- const auto new_path = FileUtil::SanitizePath(new_path_);
+VirtualFile VfsFilesystem::MoveFile(std::string_view old_path, std::string_view new_path) {
+ const auto sanitized_old_path = FileUtil::SanitizePath(old_path);
+ const auto sanitized_new_path = FileUtil::SanitizePath(new_path);
// Again, non-default impls are highly encouraged to provide a more optimized version of this.
- auto out = CopyFile(old_path_, new_path_);
+ auto out = CopyFile(sanitized_old_path, sanitized_new_path);
if (out == nullptr)
return nullptr;
- if (DeleteFile(old_path))
+ if (DeleteFile(sanitized_old_path))
return out;
return nullptr;
}
@@ -137,15 +137,15 @@ VirtualDir VfsFilesystem::CopyDirectory(std::string_view old_path_, std::string_
return new_dir;
}
-VirtualDir VfsFilesystem::MoveDirectory(std::string_view old_path_, std::string_view new_path_) {
- const auto old_path = FileUtil::SanitizePath(old_path_);
- const auto new_path = FileUtil::SanitizePath(new_path_);
+VirtualDir VfsFilesystem::MoveDirectory(std::string_view old_path, std::string_view new_path) {
+ const auto sanitized_old_path = FileUtil::SanitizePath(old_path);
+ const auto sanitized_new_path = FileUtil::SanitizePath(new_path);
// Non-default impls are highly encouraged to provide a more optimized version of this.
- auto out = CopyDirectory(old_path_, new_path_);
+ auto out = CopyDirectory(sanitized_old_path, sanitized_new_path);
if (out == nullptr)
return nullptr;
- if (DeleteDirectory(old_path))
+ if (DeleteDirectory(sanitized_old_path))
return out;
return nullptr;
}