From f3763a527592fae56401e8f8461d644ddc172d05 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 26 Nov 2022 19:03:45 +0100 Subject: [PATCH] Browser: Remove previous history entry in History::replace_current() The lack of this action caused a bug in my original patch (https://github.com/SerenityOS/serenity/pull/16004) that appeared when accessing a site that redirected the client and it was the first site the client loaded. --- Userland/Applications/Browser/History.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Applications/Browser/History.cpp b/Userland/Applications/Browser/History.cpp index 964944a364..f93d07fcc6 100644 --- a/Userland/Applications/Browser/History.cpp +++ b/Userland/Applications/Browser/History.cpp @@ -35,6 +35,7 @@ void History::replace_current(const URL& url, String const& title) if (m_current == -1) return; + m_items.remove(m_current); m_current--; push(url, title); }