Commit 977ac58a 977ac58a4362bacbf666c2e68825c21960cbcd9b by Sergey Poznyakoff

(mbox_scan): Store the number of messages into *pcount if we don't need to rescan the mailbox.

1 parent d60d3bec
...@@ -337,7 +337,7 @@ mbox_scan (mailbox_t mailbox, size_t msgno, size_t *pcount) ...@@ -337,7 +337,7 @@ mbox_scan (mailbox_t mailbox, size_t msgno, size_t *pcount)
337 return mbox_scan0 (mailbox, msgno, pcount, 1); 337 return mbox_scan0 (mailbox, msgno, pcount, 1);
338 /* Since the mailbox is already updated fake the scan. */ 338 /* Since the mailbox is already updated fake the scan. */
339 if (msgno > 0) 339 if (msgno > 0)
340 msgno--; /* The fist message is number "1", decremente for the C array. */ 340 msgno--; /* The fist message is number "1", decrement for the C array. */
341 for (i = msgno; i < mud->messages_count; i++) 341 for (i = msgno; i < mud->messages_count; i++)
342 { 342 {
343 if (observable_notify (mailbox->observable, MU_EVT_MESSAGE_ADD) != 0) 343 if (observable_notify (mailbox->observable, MU_EVT_MESSAGE_ADD) != 0)
...@@ -347,6 +347,7 @@ mbox_scan (mailbox_t mailbox, size_t msgno, size_t *pcount) ...@@ -347,6 +347,7 @@ mbox_scan (mailbox_t mailbox, size_t msgno, size_t *pcount)
347 observable_notify (mailbox->observable, MU_EVT_MAILBOX_PROGRESS); 347 observable_notify (mailbox->observable, MU_EVT_MAILBOX_PROGRESS);
348 } 348 }
349 } 349 }
350 *pcount = mud->messages_count;
350 return 0; 351 return 0;
351 } 352 }
352 353
......