From b9179de288828217a94608aeae2312f7c7146207 Mon Sep 17 00:00:00 2001 From: Eladash Date: Sat, 20 Nov 2021 10:57:49 +0200 Subject: [PATCH] Bugfix of Emulator::Load disc path searching Turns out fs::file does not always fail when provding a path to a directory. --- rpcs3/Emu/System.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 2315a95427..f3adf24b3a 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -931,7 +931,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool break; } - if (fs::file sfb_file{parent_dir + "/PS3_DISC.SFB"}; sfb_file && sfb_file.size() >= 4 && sfb_file.read() == ".SFB"_u32) + if (fs::file sfb_file{parent_dir + "/PS3_DISC.SFB"}; sfb_file && !sfb_file.stat().is_directory && sfb_file.size() >= 4 && sfb_file.read() == ".SFB"_u32) { main_dir_name = std::string_view{search_dir}.substr(search_dir.find_last_of(fs::delim) + 1);