Update POSIXFileio.cpp

This commit is contained in:
marauder2k7 2023-07-27 21:48:13 +01:00
parent f86f947f70
commit 4ae888e4f8

View file

@ -1016,19 +1016,16 @@ bool Platform::isFile(const char *pFilePath)
// Get file info // Get file info
struct stat fStat; struct stat fStat;
if (stat(pFilePath, &fStat) == 0) if (stat(pathName, &fStat) == 0)
return true; return true;
if ((fStat.st_mode & S_IFMT) == S_IFREG) if ((fStat.st_mode & S_IFMT) == S_IFREG)
return true; return true;
// Since stat failed see if it exists in a zip file loaded // Since stat failed see if it exists in a zip file loaded
if (Torque::FS::IsFile(pFilePath)) if (Torque::FS::IsFile(pathName))
return true; return true;
// if the file is a "regular file" then true
// must be some other file (directory, device, etc.) // must be some other file (directory, device, etc.)
return false; return false;
} }