From: Brendan Cully Date: Wed, 15 Mar 2006 02:02:22 +0000 (+0000) Subject: Only synthesize UIDNEXT if we've fetched uncached messages. Fixes a X-Git-Tag: mutt-1-5-12-rel~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f377a428afcc5e008f6c83d1024e95b7b02a668;p=mutt Only synthesize UIDNEXT if we've fetched uncached messages. Fixes a FETCH 1:0 bug Bruno Postle reported and helped to debug. --- diff --git a/imap/message.c b/imap/message.c index 432af024..faad9969 100644 --- a/imap/message.c +++ b/imap/message.c @@ -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,