diff -urd mutt-cvs/PATCHES mutt-new/PATCHES --- mutt-cvs/PATCHES 2002-12-09 18:44:54.000000000 +0100 +++ mutt-new/PATCHES 2006-11-22 04:15:54.000000000 +0100 @@ -0,0 +1 @@ +patch-1.5.13cvs.vl.time_inc.1 diff -urd mutt-cvs/curs_lib.c mutt-new/curs_lib.c --- mutt-cvs/curs_lib.c 2006-11-18 23:04:21.000000000 +0100 +++ mutt-new/curs_lib.c 2006-11-22 04:19:58.000000000 +0100 @@ -29,6 +29,8 @@ #include #include +#include +#include #include #include #include @@ -48,6 +50,10 @@ static size_t UngetBufLen = 0; static event_t *KeyEvent; +static struct tms tms_buf; +static unsigned long time_inc; +static unsigned long clk; + void mutt_refresh (void) { /* don't refresh when we are waiting for a child. */ @@ -332,6 +338,8 @@ { if (!progress) return; + time_inc = sysconf (_SC_CLK_TCK) / 4; + clk = times (&tms_buf); memset (progress, 0, sizeof (progress_t)); progress->inc = inc; progress->flags = flags; @@ -344,6 +352,7 @@ { char posstr[SHORT_STRING]; short update = 0; + unsigned long new_clk; if (!pos) { @@ -383,10 +392,15 @@ if (update) { progress->pos = pos; - if (progress->size) - mutt_message ("%s %s/%s", progress->msg, posstr, progress->sizestr); - else - mutt_message ("%s %s", progress->msg, posstr); + new_clk = times (&tms_buf); + if (new_clk >= clk) + { + clk = new_clk + time_inc; + if (progress->size) + mutt_message ("%s %s/%s", progress->msg, posstr, progress->sizestr); + else + mutt_message ("%s %s", progress->msg, posstr); + } } if (pos >= progress->size)