Skip to content

Commit

Permalink
IOP HLE: Fix broken dopen implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes authored and stenzek committed Dec 31, 2023
1 parent ec12d9b commit 2e0988f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pcsx2/IopBios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,12 @@ namespace R3000A
std::string relativePath = full_path.substr(full_path.find(':') + 1);
std::string path = host_path(relativePath, true);

FileSystem::FindResultsArray results;
if (!FileSystem::FindFiles(path.c_str(), "*", FILESYSTEM_FIND_FILES | FILESYSTEM_FIND_FOLDERS | FILESYSTEM_FIND_RELATIVE_PATHS | FILESYSTEM_FIND_HIDDEN_FILES, &results))
if (!FileSystem::DirectoryExists(path.c_str()))
return -IOP_ENOENT; // Should return ENOTDIR if path is a file?

FileSystem::FindResultsArray results;
FileSystem::FindFiles(path.c_str(), "*", FILESYSTEM_FIND_FILES | FILESYSTEM_FIND_FOLDERS | FILESYSTEM_FIND_RELATIVE_PATHS | FILESYSTEM_FIND_HIDDEN_FILES, &results);

*dir = new HostDir(std::move(results), std::move(path));
if (!*dir)
return -IOP_ENOMEM;
Expand Down

0 comments on commit 2e0988f

Please sign in to comment.