From d8d82215561305cb7af0a33d7810cbb9cadb2cea Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 22 Dec 2006 07:11:20 +0000 Subject: Modified front end output routines to accept a "padding' setting, which pads any statement with ' ' until the size of the terminal. The rationale is that, when a log message is emitted during progress bar display, the terminal is artifacted. This prevents that messiness. --- src/pacman/downloadprog.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pacman/downloadprog.c') diff --git a/src/pacman/downloadprog.c b/src/pacman/downloadprog.c index 06345782..16cfd6c9 100644 --- a/src/pacman/downloadprog.c +++ b/src/pacman/downloadprog.c @@ -65,6 +65,7 @@ void log_progress(const char *filename, int xfered, int total) float total_timediff, timediff; if(xfered == 0) { + set_output_padding(1); /* we need padding from pm_fprintf output */ gettimeofday(&initial_time, NULL); gettimeofday(&last_time, NULL); xfered_last = 0; @@ -88,6 +89,7 @@ void log_progress(const char *filename, int xfered, int total) /* compute final values */ rate = total / (total_timediff * 1024); eta_s = (int)total_timediff; + set_output_padding(0); /* shut off padding */ } else if(timediff < UPDATE_SPEED_SEC) { /* we avoid computing the ETA on too small periods of time, so that results are more significant */ -- cgit v1.2.3