X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mbox.c;h=639c8247a670b5546e418d832440fd1b8f6fc4e8;hp=dc900e4139b742969df91e59e8f7a5d3bc8b2469;hb=8518fe25efade712e3590e5b13537fb0021d4073;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1 diff --git a/mbox.c b/mbox.c index dc900e4..639c824 100644 --- a/mbox.c +++ b/mbox.c @@ -24,6 +24,10 @@ #include "sort.h" #include "copy.h" +#ifdef USE_COMPRESSED +#include "compress.h" +#endif + #include #include #include @@ -123,7 +127,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx) count++; if (!ctx->quiet && ReadInc && ((count % ReadInc == 0) || count == 1)) mutt_message (_("Reading %s... %d (%d%%)"), ctx->path, count, - loc / (ctx->size / 100 + 1)); + (int)(loc / (ctx->size / 100 + 1))); if (ctx->msgcount == ctx->hdrmax) @@ -282,7 +286,7 @@ int mbox_parse_mailbox (CONTEXT *ctx) if (!ctx->quiet && ReadInc && ((count % ReadInc == 0) || count == 1)) mutt_message (_("Reading %s... %d (%d%%)"), ctx->path, count, - ftell (ctx->fp) / (ctx->size / 100 + 1)); + (int)(ftell (ctx->fp) / (ctx->size / 100 + 1))); if (ctx->msgcount == ctx->hdrmax) mx_alloc_memory (ctx); @@ -787,7 +791,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint) j++; if (!ctx->quiet && WriteInc && ((i % WriteInc) == 0 || j == 1)) mutt_message (_("Writing messages... %d (%d%%)"), i, - ftell (ctx->fp) / (ctx->size / 100 + 1)); + (int)(ftell (ctx->fp) / (ctx->size / 100 + 1))); if (ctx->magic == M_MMDF) { @@ -924,8 +928,8 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint) char savefile[_POSIX_PATH_MAX]; - snprintf (savefile, sizeof (savefile), "%s/mutt.%s-%s-%d", - NONULL (Tempdir), NONULL(Username), NONULL(Hostname), getpid ()); + snprintf (savefile, sizeof (savefile), "%s/mutt.%s-%s-%u", + NONULL (Tempdir), NONULL(Username), NONULL(Hostname), (unsigned int)getpid ()); rename (tempfile, savefile); mutt_unblock_signals (); mx_fastclose_mailbox (ctx); @@ -1016,6 +1020,12 @@ bail: /* Come here in case of disaster */ int mbox_close_mailbox (CONTEXT *ctx) { mx_unlock_file (ctx->path, fileno (ctx->fp), 1); + +#ifdef USE_COMPRESSED + if (ctx->compressinfo) + mutt_slow_close_compressed (ctx); +#endif + mutt_unblock_signals (); mx_fastclose_mailbox (ctx); return 0;