From 0dc46da99f7638a991e2660bf704c2dc64fd83fb Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sun, 30 Jan 2022 20:17:42 +0100 Subject: [PATCH] open: Use more StringView instead of const char* --- Userland/Utilities/open.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Utilities/open.cpp b/Userland/Utilities/open.cpp index 77eae7deb5..72a7a75e8d 100644 --- a/Userland/Utilities/open.cpp +++ b/Userland/Utilities/open.cpp @@ -16,7 +16,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { Core::EventLoop loop; - Vector urls_or_paths; + Vector urls_or_paths; Core::ArgsParser parser; parser.set_general_help("Open a file or URL by executing the appropriate program."); parser.add_positional_argument(urls_or_paths, "URL or file path to open", "url-or-path"); @@ -26,7 +26,7 @@ ErrorOr serenity_main(Main::Arguments arguments) for (auto& url_or_path : urls_or_paths) { auto path = Core::File::real_path_for(url_or_path); - auto url = URL::create_with_url_or_path(path.is_null() ? url_or_path : path); + auto url = URL::create_with_url_or_path(path.is_null() ? url_or_path : path.view()); if (!Desktop::Launcher::open(url)) { warnln("Failed to open '{}'", url);