1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +00:00

Help: Fix search query parsing

This was failing probably because AK::URL was being too strict; and the
query emptyness check was flipped.
This commit is contained in:
kleines Filmröllchen 2022-06-24 01:07:37 +02:00 committed by Linus Groh
parent a438c4d568
commit 146bce53dd

View file

@ -19,7 +19,7 @@ using namespace Help;
static DeprecatedString parse_input(StringView input)
{
AK::URL url(input);
AK::URL url = URL::create_with_url_or_path(input);
if (url.is_valid())
return url.basename();
@ -72,7 +72,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
.accept_value = [&](char const* input_ptr) {
StringView input { input_ptr, strlen(input_ptr) };
// If start_page was already set by our section arg, then it can't be set again
if (start_page.is_empty())
if (!start_page.is_empty())
return false;
start_page = parse_input(input);
return true;