From: nion Date: Mon, 28 Feb 2005 22:33:02 +0000 (+0000) Subject: Nico Golde: X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=78f24a39b314d2c47c1417eaa34fdf4078bb4a50;hp=254adb836d2349416af564eec8280dc83ef9fc1b Nico Golde: plastic surgery on boundary condition git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@122 e385b8ad-14ed-0310-8656-cc95a2468c6d --- 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) {