Merge pull request #1876 from Parlane/is_dir_fileio_fix
Don't open a file handle for a directory in FileIO
This commit is contained in:
commit
cf8333abd2
|
@ -107,7 +107,7 @@ IPCCommandResult CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode
|
||||||
|
|
||||||
// The file must exist before we can open it
|
// The file must exist before we can open it
|
||||||
// It should be created by ISFS_CreateFile, not here
|
// It should be created by ISFS_CreateFile, not here
|
||||||
if (File::Exists(m_filepath))
|
if (File::Exists(m_filepath) && !File::IsDirectory(m_filepath))
|
||||||
{
|
{
|
||||||
INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_Name.c_str(), Modes[_Mode], _Mode);
|
INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_Name.c_str(), Modes[_Mode], _Mode);
|
||||||
ReturnValue = m_DeviceID;
|
ReturnValue = m_DeviceID;
|
||||||
|
|
Loading…
Reference in New Issue