]> granicus.if.org Git - mutt/commitdiff
Only synthesize UIDNEXT if we've fetched uncached messages. Fixes a
authorBrendan Cully <brendan@kublai.com>
Wed, 15 Mar 2006 02:02:22 +0000 (02:02 +0000)
committerBrendan Cully <brendan@kublai.com>
Wed, 15 Mar 2006 02:02:22 +0000 (02:02 +0000)
FETCH 1:0 bug Bruno Postle reported and helped to debug.

imap/message.c

index 432af0246a0ba1cbefa48652e45dac94f8b82dda..faad99696eb5cf3ca4d54a098c5a48049b7ed3d1 100644 (file)
@@ -323,9 +323,9 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
 #if USE_HCACHE
   mutt_hcache_store_raw (hc, "/UIDVALIDITY", &idata->uid_validity,
                          sizeof (idata->uid_validity), imap_hcache_keylen);
-  if (idata->uidnext < maxuid + 1)
+  if (maxuid && idata->uidnext < maxuid + 1)
   {
-    dprint (2, (debugfile, "Overriding UIDNEXT: %u -> %u", idata->uidnext, maxuid + 1));
+    dprint (2, (debugfile, "Overriding UIDNEXT: %u -> %u\n", idata->uidnext, maxuid + 1));
     idata->uidnext = maxuid + 1;
   }
   mutt_hcache_store_raw (hc, "/UIDNEXT", &idata->uidnext,