From 2dc742c9efee14ec3f51a7d87f2d3084226b14c3 Mon Sep 17 00:00:00 2001 From: Rocco Rutte <pdmef@gmx.net> Date: Fri, 23 Nov 2007 15:11:26 +0100 Subject: [PATCH] Don't attempt to print progress if inc is 0, just print initial message --- ChangeLog | 8 ++++++++ curs_lib.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 438d4e295..ea1157053 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-11-21 14:14 -0800 Ronny Haryanto <ronnylist@haryan.to> (0e99eaaecd67) + + * po/id.po: Updated Indonesian translation + +2007-11-21 16:47 +0100 Rocco Rutte <pdmef@gmx.net> (309ab3a63d91) + + * ChangeLog, UPDATING: Add UPDATING entry for $check_mbox_size + 2007-11-21 14:46 +0100 Rocco Rutte <pdmef@gmx.net> (b8d811e5931e) * init.h: Clarify the description for $timeout diff --git a/curs_lib.c b/curs_lib.c index fe3bf1931..ea3a2c0c1 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -364,6 +364,14 @@ void mutt_progress_init (progress_t* progress, const char *msg, snprintf (progress->sizestr, sizeof (progress->sizestr), "%ld", progress->size); } + if (!inc) + { + if (size) + mutt_message ("%s (%s)", msg, progress->sizestr); + else + mutt_message (msg); + return; + } if (gettimeofday (&tv, NULL) < 0) dprint (1, (debugfile, "gettimeofday failed: %d\n", errno)); /* if timestamp is 0 no time-based suppression is done */ @@ -379,8 +387,8 @@ void mutt_progress_update (progress_t* progress, long pos, int percent) struct timeval tv = { 0, 0 }; unsigned int now = 0; - if (pos && !progress->inc) - return; + if (!progress->inc) + goto out; /* refresh if size > inc */ if (progress->flags & M_PROGRESS_SIZE && @@ -429,6 +437,7 @@ void mutt_progress_update (progress_t* progress, long pos, int percent) } } +out: if (pos >= progress->size) mutt_clear_error (); } -- 2.40.0