VFS: fix /host_root

This commit is contained in:
Nekotekina 2018-09-19 14:15:38 +03:00
commit 59090f6d26

View file

@ -203,11 +203,8 @@ std::string vfs::get(std::string_view vpath, std::vector<std::string>* out_dir)
if (dir.first == name) if (dir.first == name)
{ {
list.back() = &dir.second; list.back() = &dir.second;
break;
}
}
if (last->path == "/") if (dir.second.path == "/"sv)
{ {
if (vpath.empty()) if (vpath.empty())
{ {
@ -217,6 +214,10 @@ std::string vfs::get(std::string_view vpath, std::vector<std::string>* out_dir)
// Handle /host_root (not escaped, not processed) // Handle /host_root (not escaped, not processed)
return std::string{vpath.substr(1)}; return std::string{vpath.substr(1)};
} }
break;
}
}
} }
if (result_base.empty()) if (result_base.empty())