- bug fix: when -d given, open debug file (noted by Herbert J. Skuhra <h.skuhra@gmail...
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 27 Oct 2005 19:46:12 +0000 (19:46 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Thu, 27 Oct 2005 19:46:12 +0000 (19:46 +0000)
- for buffy counting, don't force checks for sidebar (reported by Lars Ellenberg <Lars.Ellenberg@linbit.com>)

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

VERSION.svn
buffy.c
main.c

index faea12c..3bfc51a 100644 (file)
@@ -1 +1 @@
-561
+562
diff --git a/buffy.c b/buffy.c
index 126cf8c..f1b39b3 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -260,7 +260,7 @@ int buffy_parse_mailboxes (BUFFER * path, BUFFER * s, unsigned long data,
 /* values for force:
  * 0    don't force any checks + update sidebar
  * 1    force all checks + update sidebar
- * 2    force all checks + _don't_ update sidebar
+ * 2    don't force any checks + _don't_ update sidebar
  */
 int buffy_check (int force)
 {
@@ -277,7 +277,7 @@ int buffy_check (int force)
   time_t last2;
 
   /* update postponed count as well, on force */
-  if (force != 0)
+  if (force == 1)
     mutt_update_num_postponed ();
 #endif
 
@@ -294,11 +294,11 @@ int buffy_check (int force)
     return BuffyCount;
 
   last1 = BuffyTime;
-  if (force != 0 || now - BuffyTime >= BuffyTimeout)
+  if (force == 1 || now - BuffyTime >= BuffyTimeout)
     BuffyTime = now;
 #ifdef USE_IMAP
   last2 = ImapBuffyTime;
-  if (force != 0 || now - ImapBuffyTime >= ImapBuffyTimeout)
+  if (force == 1 || now - ImapBuffyTime >= ImapBuffyTimeout)
     ImapBuffyTime = now;
 #endif
   BuffyCount = 0;
@@ -337,7 +337,7 @@ int buffy_check (int force)
       case M_MBOX:
       case M_MMDF:
         /* only check on force or $mail_check reached */
-        if (force != 0 || (now - last1 >= BuffyTimeout)) {
+        if (force == 1 || (now - last1 >= BuffyTimeout)) {
           if (!count) {
             if (STAT_CHECK) {
               BuffyCount++;
@@ -373,7 +373,7 @@ int buffy_check (int force)
 
       case M_MAILDIR:
         /* only check on force or $mail_check reached */
-        if (force != 0 || (now - last1 >= BuffyTimeout)) {
+        if (force == 1 || (now - last1 >= BuffyTimeout)) {
           snprintf (path, sizeof (path), "%s/new", tmp->path);
           if ((dirp = opendir (path)) == NULL) {
             tmp->magic = 0;
@@ -431,7 +431,7 @@ int buffy_check (int force)
 
       case M_MH:
         /* only check on force or $mail_check reached */
-        if (force != 0 || (now - last1 >= BuffyTimeout)) {
+        if (force == 1 || (now - last1 >= BuffyTimeout)) {
           if ((tmp->new = mh_buffy (tmp->path)) > 0)
             BuffyCount++;
           if (count) {
@@ -461,7 +461,7 @@ int buffy_check (int force)
 #ifdef USE_IMAP
       case M_IMAP:
         /* only check on force or $imap_mail_check reached */
-        if (force != 0 || (now - last2 >= ImapBuffyTimeout)) {
+        if (force == 1 || (now - last2 >= ImapBuffyTimeout)) {
           tmp->msgcount = imap_mailbox_check (tmp->path, 0);
           tmp->new = imap_mailbox_check (tmp->path, 1);
           tmp->msg_unread = imap_mailbox_check (tmp->path, 2);
diff --git a/main.c b/main.c
index 9431929..dc83d3a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -648,9 +648,12 @@ int main (int argc, char **argv)
 
     case 'd':
       {
-        char puke[20];
-        snprintf (puke, sizeof (puke), "set debug_level=%d", atoi (optarg));
-        commands = mutt_add_list (commands, puke);
+        char buf[LONG_STRING];
+        int level = atoi (optarg);
+
+        snprintf (buf, sizeof (buf), "set debug_level=%d", level);
+        commands = mutt_add_list (commands, buf);
+        debug_setlevel (level);
       }
       break;