From: Antonio Radici Date: Wed, 27 May 2009 21:38:36 +0000 (+0100) Subject: fix index weirdness if mailbox is emptied while inside the pager (Closes: 375530) X-Git-Tag: debian/1.5.19-4~14 X-Git-Url: https://git.llucax.com/software/mutt-debian.git/commitdiff_plain/659db44480d138d8f398f9c357ff7e84bf0ac800 fix index weirdness if mailbox is emptied while inside the pager (Closes: 375530) --- diff --git a/debian/changelog b/debian/changelog index 83a9938..2ad6015 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 26 May 2009 23:42:51 +0100 diff --git a/debian/patches/series b/debian/patches/series index f1f7a21..766a143 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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 index 0000000..f3a5205 --- /dev/null +++ b/debian/patches/upstream/375530-index-weirdness.patch @@ -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: