summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2017-09-26 19:44:11 -0700
committerKevin McCarthy <kevin@8t8.us>2017-09-26 19:44:11 -0700
commit0bcb77a6c96662eedacddb030531fc80cd53ab56 (patch)
tree8eb20fd3e14995884737745d4d47a920cfaa548a
parentb333df6d9598c0934a8d682ee02419e942710357 (diff)
Fix uses of context->changed as a counter.
The first was in mx_update_tables(), but only when "not committing". This is used by mh/maildir during an "occult" update, and in imap when expunging the mailbox. It meant to simply turn on changed when a single changed header is seen. The second use was in imap_sync_message_for_copy(). Previously this was used for a server side copy/save, but is now also used for fast-trash copying. Remove the code that was trying to decrement the counter: this function is not capable of properly setting a status bit.
-rw-r--r--imap/imap.c6
-rw-r--r--mx.c2
2 files changed, 1 insertions, 7 deletions
diff --git a/imap/imap.c b/imap/imap.c
index 0bb2d5f8..b3e780c8 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -1102,10 +1102,7 @@ int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
if (!compare_flags_for_copy (hdr))
{
if (hdr->deleted == HEADER_DATA(hdr)->deleted)
- {
hdr->changed = 0;
- idata->ctx->changed--;
- }
return 0;
}
@@ -1172,10 +1169,7 @@ int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
hdr->active = 1;
if (hdr->deleted == HEADER_DATA(hdr)->deleted)
- {
hdr->changed = 0;
- idata->ctx->changed--;
- }
return 0;
}
diff --git a/mx.c b/mx.c
index 5d6782aa..1f991208 100644
--- a/mx.c
+++ b/mx.c
@@ -1054,7 +1054,7 @@ void mx_update_tables(CONTEXT *ctx, int committing)
if (committing)
ctx->hdrs[j]->changed = 0;
else if (ctx->hdrs[j]->changed)
- ctx->changed++;
+ ctx->changed = 1;
if (!committing || (ctx->magic == MUTT_MAILDIR && option (OPTMAILDIRTRASH)))
{