Commit 64f7f723 authored by Rocco Rutte's avatar Rocco Rutte

Use ftello() instead of ftell() in more places that need it (fixes

progress updates for >2 GB mbox files)
parent 2ae549db
......@@ -136,7 +136,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
count++;
if (!ctx->quiet)
mutt_progress_update (&progress, count,
(int)loc / (ctx->size / 100 + 1));
(int) (loc / (ctx->size / 100 + 1)));
if (ctx->msgcount == ctx->hdrmax)
mx_alloc_memory (ctx);
......@@ -302,7 +302,7 @@ int mbox_parse_mailbox (CONTEXT *ctx)
if (!ctx->quiet)
mutt_progress_update (&progress, count,
(int)(ftell (ctx->fp) / (ctx->size / 100 + 1)));
(int)(ftello (ctx->fp) / (ctx->size / 100 + 1)));
if (ctx->msgcount == ctx->hdrmax)
mx_alloc_memory (ctx);
......@@ -799,7 +799,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
for (i = first, j = 0; i < ctx->msgcount; i++)
{
if (!ctx->quiet)
mutt_progress_update (&progress, i, (int)(ftell (ctx->fp) / (ctx->size / 100 + 1)));
mutt_progress_update (&progress, i, (int)(ftello (ctx->fp) / (ctx->size / 100 + 1)));
/*
* back up some information which is needed to restore offsets when
* something fails.
......
......@@ -2668,7 +2668,7 @@ int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post,
rewind (tempfp);
while (fgets (sasha, sizeof (sasha), tempfp) != NULL)
lines++;
fprintf (msg->fp, "Content-Length: " OFF_T_FMT "\n", (LOFF_T) ftell (tempfp));
fprintf (msg->fp, "Content-Length: " OFF_T_FMT "\n", (LOFF_T) ftello (tempfp));
fprintf (msg->fp, "Lines: %d\n\n", lines);
/* copy the body and clean up */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment