From dcfc552d258b80f0a081267fca9b10797f5330aa Mon Sep 17 00:00:00 2001 From: stasoid Date: Mon, 17 Feb 2025 18:12:16 +0500 Subject: [PATCH] AK: Don't crash on empty extension in LexicalPath::has_extension ... on Windows --- AK/LexicalPathWindows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/LexicalPathWindows.cpp b/AK/LexicalPathWindows.cpp index c6f46162f0b..d35804a7688 100644 --- a/AK/LexicalPathWindows.cpp +++ b/AK/LexicalPathWindows.cpp @@ -60,7 +60,7 @@ Vector LexicalPath::parts() const bool LexicalPath::has_extension(StringView extension) const { - if (extension[0] == '.') + if (extension.starts_with('.')) extension = extension.substring_view(1); return m_extension.equals_ignoring_ascii_case(extension); }