Fix exists check in VFSFileSystem::GetFileInfo().

Only matters if it can't map the path / doesn't have the apk mapped (e.g.
as on headless right now.)
This commit is contained in:
Unknown W. Brackets
2014-03-23 13:01:52 -07:00
parent 56b83af1f0
commit 3a376a0cd9

View File

@@ -833,11 +833,14 @@ PSPFileInfo VFSFileSystem::GetFileInfo(std::string filename) {
std::string fullName = GetLocalPath(filename);
INFO_LOG(FILESYS,"Getting VFS file info %s (%s)", fullName.c_str(), filename.c_str());
FileInfo fo;
VFSGetFileInfo(fullName.c_str(), &fo);
x.exists = fo.exists;
if (x.exists) {
x.size = fo.size;
x.type = fo.isDirectory ? FILETYPE_DIRECTORY : FILETYPE_NORMAL;
if (VFSGetFileInfo(fullName.c_str(), &fo)) {
x.exists = fo.exists;
if (x.exists) {
x.size = fo.size;
x.type = fo.isDirectory ? FILETYPE_DIRECTORY : FILETYPE_NORMAL;
}
} else {
x.exists = false;
}
INFO_LOG(FILESYS,"Got VFS file info: size = %i", (int)x.size);
return x;