[VFS] Fixed crash on filename extraction from path.

Names are in CP1252 which fails conversion to utf8.
This commit is contained in:
Gliniak
2024-08-31 18:15:13 +02:00
parent 59eed7818f
commit 02f5316562
18 changed files with 44 additions and 29 deletions

View File

@@ -16,10 +16,12 @@
namespace xe {
namespace vfs {
Entry::Entry(Device* device, Entry* parent, const std::string_view path)
Entry::Entry(Device* device, Entry* parent, const std::string_view path,
const std::string_view name)
: device_(device),
parent_(parent),
path_(path),
name_(name),
attributes_(0),
size_(0),
allocation_size_(0),
@@ -29,7 +31,6 @@ Entry::Entry(Device* device, Entry* parent, const std::string_view path)
delete_on_close_(false) {
assert_not_null(device);
absolute_path_ = xe::utf8::join_guest_paths(device->mount_path(), path);
name_ = xe::utf8::find_name_from_guest_path(path);
}
Entry::~Entry() = default;