<<< Date Index >>>     <<< Thread Index >>>

patch for broken percentage displays reading mailboxes



Hi, off_t is a 64-bit number (like on Mac OS X/darwin), the percentages
don't show right while mutt is reading/parsing a mailbox.  Here's a patch
(against 1.5.6i) to fix that.

.. Juan
*** mbox.c.orig Wed Nov  5 10:41:32 2003
--- mbox.c      Fri Feb  6 23:05:52 2004
***************
*** 123,129 ****
        count++;
        if (!ctx->quiet && ReadInc && ((count % ReadInc == 0) || count == 1))
        mutt_message (_("Reading %s... %d (%d%%)"), ctx->path, count,
!                     loc / (ctx->size / 100 + 1));
  
  
        if (ctx->msgcount == ctx->hdrmax)
--- 123,129 ----
        count++;
        if (!ctx->quiet && ReadInc && ((count % ReadInc == 0) || count == 1))
        mutt_message (_("Reading %s... %d (%d%%)"), ctx->path, count,
!                     (int)(loc / (ctx->size / 100 + 1)));
  
  
        if (ctx->msgcount == ctx->hdrmax)
***************
*** 282,288 ****
  
        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));
  
        if (ctx->msgcount == ctx->hdrmax)
        mx_alloc_memory (ctx);
--- 282,288 ----
  
        if (!ctx->quiet && ReadInc && ((count % ReadInc == 0) || count == 1))
        mutt_message (_("Reading %s... %d (%d%%)"), ctx->path, count,
!                     (int)(ftell (ctx->fp) / (ctx->size / 100 + 1)));
  
        if (ctx->msgcount == ctx->hdrmax)
        mx_alloc_memory (ctx);
***************
*** 787,793 ****
        j++;
        if (!ctx->quiet && WriteInc && ((i % WriteInc) == 0 || j == 1))
        mutt_message (_("Writing messages... %d (%d%%)"), i,
!                     ftell (ctx->fp) / (ctx->size / 100 + 1));
  
        if (ctx->magic == M_MMDF)
        {
--- 787,793 ----
        j++;
        if (!ctx->quiet && WriteInc && ((i % WriteInc) == 0 || j == 1))
        mutt_message (_("Writing messages... %d (%d%%)"), i,
!                     (int)(ftell (ctx->fp) / (ctx->size / 100 + 1)));
  
        if (ctx->magic == M_MMDF)
        {