1
0
Fork 0
forked from suyu/suyu

vfs_real: use open file size for getting size (#11016)

This commit is contained in:
liamwhite 2023-07-06 17:43:53 -04:00 committed by GitHub
parent d8eb37fbec
commit 8bf46f48f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -283,7 +283,8 @@ std::size_t RealVfsFile::GetSize() const {
if (size) { if (size) {
return *size; return *size;
} }
return FS::GetSize(path); auto lk = base.RefreshReference(path, perms, *reference);
return reference->file ? reference->file->GetSize() : 0;
} }
bool RealVfsFile::Resize(std::size_t new_size) { bool RealVfsFile::Resize(std::size_t new_size) {