Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 8 Sep 2005 22:54:23 +0000 (22:54 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 8 Sep 2005 22:54:23 +0000 (22:54 +0000)
- correct use of str_eq() to actually make 'unmailboxes *' do something (ntnva: jnf V qehax?)
- always redraw sidebar after handling (un)mailboxes to get changes in

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@494 e385b8ad-14ed-0310-8656-cc95a2468c6d

VERSION.svn
buffy.c
sidebar.c

index 6cd3ae2..9bae829 100644 (file)
@@ -1 +1 @@
-493
+494
diff --git a/buffy.c b/buffy.c
index 59852c8..6293bbb 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -199,8 +199,9 @@ int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
     mutt_extract_token (path, s, 0);
     strfcpy (buf, path->data, sizeof (buf));
 
     mutt_extract_token (path, s, 0);
     strfcpy (buf, path->data, sizeof (buf));
 
-    if (data == M_UNMAILBOXES && str_eq (buf, "*") == 0) {
+    if (data == M_UNMAILBOXES && str_eq (buf, "*")) {
       list_del (&Incoming, (list_del_t*) buffy_free);
       list_del (&Incoming, (list_del_t*) buffy_free);
+      sidebar_draw (CurrentMenu);
       return 0;
     }
 
       return 0;
     }
 
@@ -245,6 +246,7 @@ int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
       tmp->size = 0;
 #endif /* BUFFY_SIZE */
   }
       tmp->size = 0;
 #endif /* BUFFY_SIZE */
   }
+  sidebar_draw (CurrentMenu);
   return 0;
 }
 
   return 0;
 }
 
index ba4d4a4..a9b0788 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -40,10 +40,14 @@ void calc_boundaries (int menu)
 
   if (list_empty(Incoming))
     return;
 
   if (list_empty(Incoming))
     return;
+  if (CurBuffy < 0 || CurBuffy >= Incoming->length)
+    CurBuffy = 0;
+  if (TopBuffy < 0 || TopBuffy >= Incoming->length)
+    TopBuffy = 0;
   /* correct known_lines if it has changed because of a window resize */
   /*  if (known_lines != LINES)
     known_lines = LINES; */
   /* correct known_lines if it has changed because of a window resize */
   /*  if (known_lines != LINES)
     known_lines = LINES; */
-  
+
   lines = LINES - 2 - (menu != MENU_PAGER || option (OPTSTATUSONTOP));
   known_lines = lines;
   if (option (OPTSIDEBARNEWMAILONLY)) {
   lines = LINES - 2 - (menu != MENU_PAGER || option (OPTSTATUSONTOP));
   known_lines = lines;
   if (option (OPTSIDEBARNEWMAILONLY)) {