summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-22 02:54:07 -0400
committerGravatar Lioncash2018-07-22 03:22:28 -0400
commit0081252d317af44b3e810d7f31fdd3fb03b8e23c (patch)
tree4237df67a4938585d9485fc07551c470e8527dde
parentfile_util, vfs: Use std::string_view where applicable (diff)
downloadyuzu-0081252d317af44b3e810d7f31fdd3fb03b8e23c.tar.gz
yuzu-0081252d317af44b3e810d7f31fdd3fb03b8e23c.tar.xz
yuzu-0081252d317af44b3e810d7f31fdd3fb03b8e23c.zip
vfs: Correct file_p variable usage within InterpretAsDirectory()
ReplaceFileWithSubdirectory() takes a VirtualFile and a VirtualDir, but it was being passed a string as one of its arguments. The only reason this never caused issues is because this template isn't instantiated anywhere yet. This corrects an issue before it occurs.
-rw-r--r--src/core/file_sys/vfs.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h
index 529c6c952..4a13b8378 100644
--- a/src/core/file_sys/vfs.h
+++ b/src/core/file_sys/vfs.h
@@ -205,9 +205,12 @@ struct VfsDirectory : NonCopyable {
205 template <typename Directory> 205 template <typename Directory>
206 bool InterpretAsDirectory(std::string_view file) { 206 bool InterpretAsDirectory(std::string_view file) {
207 auto file_p = GetFile(file); 207 auto file_p = GetFile(file);
208 if (file_p == nullptr) 208
209 if (file_p == nullptr) {
209 return false; 210 return false;
210 return ReplaceFileWithSubdirectory(file, std::make_shared<Directory>(file_p)); 211 }
212
213 return ReplaceFileWithSubdirectory(file_p, std::make_shared<Directory>(file_p));
211 } 214 }
212 215
213protected: 216protected: