]> granicus.if.org Git - neomutt/commitdiff
Bug fix: reset ctx->vsize in update_index_unthreaded on reopened mailbox
authorVincent Lefevre <vincent@vinc17.net>
Sat, 21 Jul 2018 23:46:03 +0000 (01:46 +0200)
committerRichard Russon <rich@flatcap.org>
Sat, 1 Sep 2018 17:06:08 +0000 (18:06 +0100)
This fixes a bug observed when doing the following:
1. Start Mutt on some mailbox.
2. Limit the view.
3. Set sort by date (thus unthreaded).
4. Set $status_format to display the size of the messages shown (%L).
5. Copy a message matching the limit pattern to this mailbox.
6. With another Mutt instance, remove this message from this mailbox.
7. Move the cursor to update the view.
Result: one was getting a value equal to twice the initial size.

curs_main.c

index 06c7da05b3e11e08c207211d83ca1104099291de..3ba1e963548acdeb060a8ac3260d5b75a8d1761a 100644 (file)
@@ -458,7 +458,10 @@ static void update_index_unthreaded(struct Context *ctx, int check, int oldcount
     for (int i = (check == MUTT_REOPENED) ? 0 : oldcount; i < ctx->msgcount; i++)
     {
       if (!i)
+      {
         ctx->vcount = 0;
+        ctx->vsize = 0;
+      }
 
       if (mutt_pattern_exec(ctx->limit_pattern, MUTT_MATCH_FULL_ADDRESS, ctx,
                             ctx->hdrs[i], NULL))