From: Thomas Roessler Date: Tue, 25 Jul 2000 08:02:12 +0000 (+0000) Subject: Try to fix a segmentation fault in the index. X-Git-Tag: mutt-1-3-6-rel~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=520661b7402e446ccd69b782f31d7fcf9cd80ad8;p=mutt Try to fix a segmentation fault in the index. --- diff --git a/curs_main.c b/curs_main.c index b92429ac..a09724de 100644 --- a/curs_main.c +++ b/curs_main.c @@ -434,8 +434,8 @@ int mutt_index_menu (void) #ifdef USE_IMAP imap_allow_reopen (Context); #endif - - index_hint = (Context->vcount) ? CURHDR->index : 0; + + index_hint = (Context->vcount && menu->current < Context->vcount) ? CURHDR->index : 0; if ((check = mx_check_mailbox (Context, &index_hint, 0)) < 0) { @@ -527,7 +527,10 @@ int mutt_index_menu (void) } menu->redraw = 0; - menu->oldcurrent = menu->current; + if (menu->current < menu->max) + menu->oldcurrent = menu->current; + else + menu->oldcurrent = -1; if (option (OPTARROWCURSOR)) move (menu->current - menu->top + menu->offset, 2); @@ -738,7 +741,8 @@ int mutt_index_menu (void) case OP_MAIN_LIMIT: CHECK_MSGCOUNT; - menu->oldcurrent = Context->vcount ? CURHDR->index : -1; + menu->oldcurrent = (Context->vcount && menu->current < Context->vcount) ? + CURHDR->index : -1; if (mutt_pattern_func (M_LIMIT, _("Limit to messages matching: ")) == 0) { if (menu->oldcurrent >= 0)