From 1dfebf6c7f49d670e03babf389b170623902bf0b Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 24 Aug 2008 03:05:00 +0200 Subject: [PATCH] Use the right index for Undo Close Tab. --- midori/midori-browser.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 146070df..6ac96059 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2650,10 +2650,14 @@ static void _action_undo_tab_close_activate (GtkAction* action, MidoriBrowser* browser) { + guint last; + KatzeXbelItem* item; + guint n; + /* Reopen the most recent trash item */ - guint length = midori_web_list_get_length (browser->trash); - KatzeXbelItem* item = midori_web_list_get_nth_item (browser->trash, length); - gint n = midori_browser_add_xbel_item (browser, item); + last = midori_web_list_get_length (browser->trash) - 1; + item = midori_web_list_get_nth_item (browser->trash, last); + n = midori_browser_add_xbel_item (browser, item); midori_browser_set_current_page (browser, n); midori_web_list_remove_item (browser->trash, item); _midori_browser_update_actions (browser);