Browse Source

first check _both_ bounds, then compare ...

wip/ssl-fprint
Oswald Buddenhagen 21 years ago
parent
commit
86d9a3140d
  1. 23
      src/drv_maildir.c

23
src/drv_maildir.c

@ -822,11 +822,28 @@ maildir_rescan( maildir_store_t *ctx )
for (msgapp = &ctx->gen.msgs, i = 0; for (msgapp = &ctx->gen.msgs, i = 0;
(msg = (maildir_message_t *)*msgapp) || i < msglist.nents; ) (msg = (maildir_message_t *)*msgapp) || i < msglist.nents; )
{ {
if (!msg || msglist.ents[i].uid < msg->gen.uid) { if (!msg) {
#if 0
debug( "adding new message %d\n", msglist.ents[i].uid );
maildir_app_msg( ctx, &msgapp, msglist.ents + i );
#else
debug( "ignoring new message %d\n", msglist.ents[i].uid ); debug( "ignoring new message %d\n", msglist.ents[i].uid );
/* maildir_app_msg( ctx, &msgapp, msglist.ents + i ); */ #endif
i++;
} else if (i >= msglist.nents) {
debug( "purging deleted message %d\n", msg->gen.uid );
msg->gen.status = M_DEAD;
msgapp = &msg->gen.next;
} else if (msglist.ents[i].uid < msg->gen.uid) {
/* this should not happen, actually */
#if 0
debug( "adding new message %d\n", msglist.ents[i].uid );
maildir_app_msg( ctx, &msgapp, msglist.ents + i );
#else
debug( "ignoring new message %d\n", msglist.ents[i].uid );
#endif
i++; i++;
} else if (i >= msglist.nents || msglist.ents[i].uid > msg->gen.uid) { } else if (msglist.ents[i].uid > msg->gen.uid) {
debug( "purging deleted message %d\n", msg->gen.uid ); debug( "purging deleted message %d\n", msg->gen.uid );
msg->gen.status = M_DEAD; msg->gen.status = M_DEAD;
msgapp = &msg->gen.next; msgapp = &msg->gen.next;

Loading…
Cancel
Save