Fix Emulator::IsPathInsideDir

This commit is contained in:
Eladash 2021-09-16 12:50:30 +03:00 committed by Megamouse
parent 3e84a2acc0
commit 5736fa3351

View File

@ -1903,7 +1903,9 @@ std::set<std::string> Emulator::GetGameDirs() const
bool Emulator::IsPathInsideDir(std::string_view path, std::string_view dir) const
{
return (GetCallbacks().resolve_path(path) + '/').starts_with(GetCallbacks().resolve_path(dir) + '/');
const std::string dir_path = GetCallbacks().resolve_path(dir);
return !dir_path.empty() && (GetCallbacks().resolve_path(path) + '/').starts_with(dir_path + '/');
};
const std::string& Emulator::GetFakeCat() const