forked from ShuriZma/suyu
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.
This commit is contained in:
parent
398444e676
commit
0081252d31
|
@ -205,9 +205,12 @@ struct VfsDirectory : NonCopyable {
|
||||||
template <typename Directory>
|
template <typename Directory>
|
||||||
bool InterpretAsDirectory(std::string_view file) {
|
bool InterpretAsDirectory(std::string_view file) {
|
||||||
auto file_p = GetFile(file);
|
auto file_p = GetFile(file);
|
||||||
if (file_p == nullptr)
|
|
||||||
|
if (file_p == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
return ReplaceFileWithSubdirectory(file, std::make_shared<Directory>(file_p));
|
}
|
||||||
|
|
||||||
|
return ReplaceFileWithSubdirectory(file_p, std::make_shared<Directory>(file_p));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue