diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 5897e2472f..45fd9f6b03 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -574,7 +574,7 @@ if (BUILD_LAGOM) target_link_libraries(wasm LibCore LibFileSystem LibWasm LibLine LibMain LibJS) add_executable(xml ../../Userland/Utilities/xml.cpp) - target_link_libraries(xml LibCore LibXML LibMain) + target_link_libraries(xml LibCore LibFileSystem LibMain LibXML) add_executable(xzcat ../../Userland/Utilities/xzcat.cpp) target_link_libraries(xzcat LibCompress LibCore LibMain) diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 60d5c735ab..19efb00005 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -152,7 +152,7 @@ target_link_libraries(wasm PRIVATE LibFileSystem LibJS LibLine LibWasm) target_link_libraries(watch PRIVATE LibFileSystem) target_link_libraries(which PRIVATE LibFileSystem) target_link_libraries(wsctl PRIVATE LibGUI LibIPC) -target_link_libraries(xml PRIVATE LibXML) +target_link_libraries(xml PRIVATE LibFileSystem LibXML) target_link_libraries(xzcat PRIVATE LibCompress) target_link_libraries(zip PRIVATE LibArchive LibCompress LibCrypto LibFileSystem) diff --git a/Userland/Utilities/xml.cpp b/Userland/Utilities/xml.cpp index 65fb0d4aa0..8097c17f24 100644 --- a/Userland/Utilities/xml.cpp +++ b/Userland/Utilities/xml.cpp @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -355,7 +355,7 @@ static void dump(XML::Document& document) dump(document.root()); } -static DeprecatedString s_path; +static String 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 const&) -> ErrorOr { - auto base = URL::create_with_file_scheme(s_path); + auto base = URL::create_with_file_scheme(s_path.to_deprecated_string()); auto url = URLParser::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); + auto base_path = LexicalPath::dirname(s_path.to_deprecated_string()); while (!suites.is_empty()) { auto& node = *suites.dequeue(); @@ -516,7 +516,7 @@ ErrorOr serenity_main(Main::Arguments arguments) parser.add_positional_argument(filename, "File to read from", "file"); parser.parse(arguments); - s_path = Core::DeprecatedFile::real_path_for(filename); + s_path = TRY(FileSystem::real_path(filename)); auto file = TRY(Core::File::open(s_path, Core::File::OpenMode::Read)); auto contents = TRY(file->read_until_eof());