mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
VFS: Fix mounting non-existant paths (#13488)
This commit is contained in:
parent
2de4c03faa
commit
8bc92a2cbb
@ -71,6 +71,8 @@ bool vfs::mount(std::string_view vpath, std::string_view path, bool is_dir)
|
||||
{
|
||||
// Mounting completed; fixup for directories due to resolve_path messing with trailing /
|
||||
list.back()->path = Emu.GetCallbacks().resolve_path(path);
|
||||
if (list.back()->path.empty())
|
||||
list.back()->path = std::string(path); // Fallback when resolving failed
|
||||
if (is_dir && !list.back()->path.ends_with('/'))
|
||||
list.back()->path += '/';
|
||||
if (!is_dir && list.back()->path.ends_with('/'))
|
||||
|
@ -327,6 +327,7 @@ EmuCallbacks main_application::CreateCallbacks()
|
||||
|
||||
callbacks.resolve_path = [](std::string_view sv)
|
||||
{
|
||||
// May result in an empty string if path does not exist
|
||||
return QFileInfo(QString::fromUtf8(sv.data(), static_cast<int>(sv.size()))).canonicalFilePath().toStdString();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user