mirror of https://github.com/RPCS3/rpcs3.git
VFS: fix missing path deliminators
This commit is contained in:
parent
ef0bee9228
commit
84753db574
|
@ -49,7 +49,6 @@ bool vfs::mount(std::string_view vpath, std::string_view path)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool delim_suffixed = path.ends_with(fs::delim);
|
|
||||||
std::string final_path = fs::resolve_path(path);
|
std::string final_path = fs::resolve_path(path);
|
||||||
|
|
||||||
if (final_path.empty())
|
if (final_path.empty())
|
||||||
|
@ -58,7 +57,7 @@ bool vfs::mount(std::string_view vpath, std::string_view path)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!final_path.ends_with(fs::delim) && delim_suffixed)
|
if (!final_path.ends_with(fs::delim[0]) && !final_path.ends_with(fs::delim[1]) && (path.ends_with(fs::delim[0]) || path.ends_with(fs::delim[1])))
|
||||||
{
|
{
|
||||||
final_path += '/';
|
final_path += '/';
|
||||||
}
|
}
|
||||||
|
@ -83,7 +82,7 @@ bool vfs::mount(std::string_view vpath, std::string_view path)
|
||||||
{
|
{
|
||||||
// Mounting completed
|
// Mounting completed
|
||||||
list.back()->path = std::move(final_path);
|
list.back()->path = std::move(final_path);
|
||||||
vfs_log.notice("Mounted path \"%s\" to \"%s\"", vpath_backup, final_path);
|
vfs_log.notice("Mounted path \"%s\" to \"%s\"", vpath_backup, list.back()->path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue