diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-26 10:13:39 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-26 10:13:39 +0000 |
commit | 0f734626da2f8823d66c61f57b44d7f42a807282 (patch) | |
tree | d2c1a07a77b52185624071d1a453db392be9ee4f /mh.c | |
parent | 93f7cf1e47ecaef54e4da1ae1a2d7f26fa09e2ce (diff) |
Changing the index_hint handling for mh folders once again.
Diffstat (limited to 'mh.c')
-rw-r--r-- | mh.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -581,7 +581,7 @@ int mh_check_mailbox(CONTEXT *ctx, int *index_hint) struct maildir *md, *p; struct maildir **last; HASH *fnames; - int i, idx; + int i, deleted; if(!option (OPTCHECKNEW)) return 0; @@ -660,7 +660,7 @@ int mh_check_mailbox(CONTEXT *ctx, int *index_hint) hash_insert(fnames, p->canon_fname, p, 0); } - if(index_hint) idx = *index_hint; + deleted = 0; for(i = 0; i < ctx->msgcount; i++) { @@ -695,12 +695,14 @@ int mh_check_mailbox(CONTEXT *ctx, int *index_hint) /* the message has disappeared by occult forces, correct * the index hint. */ - - if(modified && index_hint && (i <= *index_hint)) - idx--; + if(modified && index_hint && (i < *index_hint)) + deleted++; } + + if(modified && index_hint && i == *index_hint) + *index_hint -= deleted; } - + hash_destroy(&fnames, NULL); if(modified) @@ -708,9 +710,6 @@ int mh_check_mailbox(CONTEXT *ctx, int *index_hint) maildir_move_to_context(ctx, &md); - if(index_hint) - *index_hint = idx; - return modified ? M_REOPENED : have_new ? M_NEW_MAIL : 0; } |