1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

LibFileSystem+Userland: Return ByteString from real_path()

This commit is contained in:
Sam Atkins 2024-01-15 16:23:24 +00:00 committed by Sam Atkins
parent cdf17efb9a
commit 56c5ffe398
25 changed files with 44 additions and 40 deletions

View file

@ -355,7 +355,7 @@ static void dump(XML::Document& document)
dump(document.root());
}
static String s_path;
static ByteString s_path;
static auto parse(StringView contents)
{
return XML::Parser {
@ -363,7 +363,7 @@ static auto parse(StringView contents)
{
.preserve_comments = true,
.resolve_external_resource = [&](XML::SystemID const& system_id, Optional<XML::PublicID> const&) -> ErrorOr<ByteString> {
auto base = URL::create_with_file_scheme(s_path.to_byte_string());
auto base = URL::create_with_file_scheme(s_path);
auto url = URLParser::basic_parse(system_id.system_literal, base);
if (!url.is_valid())
return Error::from_string_literal("Invalid URL");
@ -402,7 +402,7 @@ static void do_run_tests(XML::Document& document)
dump_cases(root);
auto base_path = LexicalPath::dirname(s_path.to_byte_string());
auto base_path = LexicalPath::dirname(s_path);
while (!suites.is_empty()) {
auto& node = *suites.dequeue();