]> git.llucax.com Git - software/mutt-debian.git/commitdiff
fix index weirdness if mailbox is emptied while inside the pager (Closes: 375530)
authorAntonio Radici <antonio@dyne.org>
Wed, 27 May 2009 21:38:36 +0000 (22:38 +0100)
committerAntonio Radici <antonio@dyne.org>
Wed, 27 May 2009 21:38:36 +0000 (22:38 +0100)
debian/changelog
debian/patches/series
debian/patches/upstream/375530-index-weirdness.patch [new file with mode: 0644]

index 83a9938812b78338ca87e09e1d5f4fa0bceebc49..2ad601599605b2be5f327405a537668dfc6eebed 100644 (file)
@@ -11,6 +11,8 @@ mutt (1.5.19-4) unstable; urgency=low
     + document the mandatory usage of -- with the -a option (Closes: 530661)
   * patches/features/sensible_browser_position
     + modified so mutt does not segfault when the last mailbox is removed (Closes: 439387)
+  * patches/upstream/375530-index-weirdness.patch
+    + fix index weirdness if mailbox is emptied while inside the pager (Closes: 375530)
 
  -- Antonio Radici <antonio@dyne.org>  Tue, 26 May 2009 23:42:51 +0100
 
index f1f7a210b66ddc1eaf4ae0eca56fc64ac6b2cdf7..766a143064fb24fbad4f08cb4cb86a83dbf171f0 100644 (file)
@@ -30,6 +30,7 @@ misc/smime.rc
 upstream/500016-temp-cache-fix.patch
 upstream/508988-inode-sort.patch
 upstream/530661-mandatory-doubledash.patch
+upstream/375530-index-weirdness.patch
 
 misc/hyphen-as-minus.patch
 misc/smime_keys-manpage.patch
diff --git a/debian/patches/upstream/375530-index-weirdness.patch b/debian/patches/upstream/375530-index-weirdness.patch
new file mode 100644 (file)
index 0000000..f3a5205
--- /dev/null
@@ -0,0 +1,34 @@
+Actually reopen mbox/mmdf files in case we find modifications. Closes 
+http://bugs.mutt.org/2725.
+
+Since the file is changed while we have it open in ctx->fp, we likely
+get wrong information when parsing the mailbox. Now we explicitely close
+and (re)open it.
+
+See http://bugs.debian.org/375530 for more info
+
+--- a/mbox.c
++++ b/mbox.c
+@@ -1119,17 +1119,13 @@
+   {
+     case M_MBOX:
+     case M_MMDF:
+-      if (fseek (ctx->fp, 0, SEEK_SET) != 0)
+-      {
+-        dprint (1, (debugfile, "mutt_reopen_mailbox: fseek() failed\n"));
++      cmp_headers = mbox_strict_cmp_headers;
++      safe_fclose (&ctx->fp);
++      if (!(ctx->fp = safe_fopen (ctx->path, "r")))
+         rc = -1;
+-      } 
+-      else 
+-      {
+-        cmp_headers = mbox_strict_cmp_headers;
++      else
+         rc = ((ctx->magic == M_MBOX) ? mbox_parse_mailbox
+-                                   : mmdf_parse_mailbox) (ctx);
+-      }
++                                  : mmdf_parse_mailbox) (ctx);
+       break;
+     default: