]> granicus.if.org Git - neomutt/commitdiff
imap: fixing race when syncing mailbox
authorMehdi Abaakouk <sileht@sileht.net>
Wed, 24 Apr 2019 14:34:35 +0000 (16:34 +0200)
committerRichard Russon <rich@flatcap.org>
Wed, 24 Apr 2019 15:06:36 +0000 (16:06 +0100)
imap_check_mailbox return an detailled state not only 0/-1.

imap_sync_mailbox assumes that the function was returning only 0/-1.

This change fixes that.

imap/imap.c

index 2fcce17c45fed4245a1684b92a93f296d9bd3cf6..c153d1f692e818d094aa12411e7d0513fb837d77 100644 (file)
@@ -1652,7 +1652,7 @@ int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close)
   imap_allow_reopen(m);
 
   rc = imap_check_mailbox(m, false);
-  if (rc != 0)
+  if (rc < 0)
     return rc;
 
   /* if we are expunging anyway, we can do deleted messages very quickly... */