mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 16:01:42 +12:00
Try to fix some fs errors
This commit is contained in:
parent
a428dac71c
commit
5c93acefd9
3 changed files with 138 additions and 17 deletions
|
@ -26,24 +26,36 @@ bool vfs::mount(const std::string& dev_name, const std::string& path)
|
|||
|
||||
std::string vfs::get(const std::string& vpath, vfs::type _type)
|
||||
{
|
||||
const auto table = fxm::get_always<vfs_manager>();
|
||||
|
||||
reader_lock lock(table->mutex);
|
||||
|
||||
std::smatch match;
|
||||
|
||||
if (!std::regex_match(vpath, match, _type == type::ps3 ? s_regex_ps3 : s_regex_psv))
|
||||
{
|
||||
LOG_WARNING(GENERAL, "vfs::get(): invalid input: %s", vpath);
|
||||
return{};
|
||||
const auto found = table->mounted.find("");
|
||||
|
||||
if (found == table->mounted.end())
|
||||
{
|
||||
LOG_WARNING(GENERAL, "vfs::get(): no default directory: %s", vpath);
|
||||
return {};
|
||||
}
|
||||
|
||||
return found->second + vpath;
|
||||
}
|
||||
|
||||
const auto table = fxm::get_always<vfs_manager>();
|
||||
|
||||
reader_lock lock(table->mutex);
|
||||
if (_type == type::ps3 && match.length(1) == 0)
|
||||
{
|
||||
return "/";
|
||||
}
|
||||
|
||||
const auto found = table->mounted.find(match.str(1));
|
||||
|
||||
if (found == table->mounted.end())
|
||||
{
|
||||
LOG_WARNING(GENERAL, "vfs::get(): device not found: %s", vpath);
|
||||
return{};
|
||||
return {};
|
||||
}
|
||||
|
||||
// Concatenate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue