From c836c3e559e910b9ef3a62261a26d287c853bcf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Sat, 18 Sep 2010 12:33:05 +0000 Subject: [PATCH] Completly disable the progress indicator when reading a compressed log file. --- log.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/log.c b/log.c index 1936041..e3ee729 100644 --- a/log.c +++ b/log.c @@ -868,9 +868,9 @@ int main(int argc,char *argv[]) } recs2++; - if( ShowReadStatistics && !from_stdin && --OutputNonZero<=0) { + if( ShowReadStatistics && !from_stdin && !from_pipe && --OutputNonZero<=0) { double perc = recs2 * 100. / recs1 ; - printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs1,perc); + printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs2,perc); putchar('\r'); fflush (stdout); OutputNonZero = REPORT_EVERY_X_LINES ; @@ -1536,10 +1536,11 @@ int main(int argc,char *argv[]) if (!from_stdin) { if (from_pipe) pclose(fp_in); - else + else { fclose(fp_in); - if( ShowReadStatistics ) - printf(_("SARG: Records in file: %lu, reading: %3.2f%%\n"),recs1, (float) 100 ); + if( ShowReadStatistics ) + printf(_("SARG: Records in file: %lu, reading: %3.2f%%\n"),recs1, (float) 100 ); + } } } -- 2.47.3