From 78f24a39b314d2c47c1417eaa34fdf4078bb4a50 Mon Sep 17 00:00:00 2001 From: nion Date: Mon, 28 Feb 2005 22:33:02 +0000 Subject: [PATCH] Nico Golde: plastic surgery on boundary condition git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@122 e385b8ad-14ed-0310-8656-cc95a2468c6d --- sidebar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sidebar.c b/sidebar.c index bcaa0a7..9290a1a 100644 --- a/sidebar.c +++ b/sidebar.c @@ -66,19 +66,20 @@ void calc_boundaries (int menu) tmp = Incoming; while (tmp != CurBuffy) { - position++; - tmp = tmp->next; + position++; + tmp = tmp->next; } // calculate the size of the screen we can use count = LINES - 2 - (menu != MENU_PAGER || option (OPTSTATUSONTOP)); // calculate the position of the current mailbox on the screen mailbox_position = position%count; + if (mailbox_position == 0) mailbox_position=count; // determine topbuffy TopBuffy = CurBuffy; for(i = mailbox_position; i >1; i--) TopBuffy = TopBuffy->prev; // determine bottombuffy BottomBuffy = CurBuffy; - for(i = mailbox_position; i <= count && BottomBuffy->next; i++) BottomBuffy = BottomBuffy->next; + for(i = mailbox_position; i < count && BottomBuffy->next; i++) BottomBuffy = BottomBuffy->next; } static char * shortened_hierarchy(char * box) { -- 2.20.1