From: Frédéric Marchal Date: Wed, 14 Jul 2010 19:43:13 +0000 (+0000) Subject: Completly disable the progress indicator when reading a compressed log file. X-Git-Tag: v2.3.1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43273c35be0e230f3828b70902fcc9ec693d5c75;p=thirdparty%2Fsarg.git Completly disable the progress indicator when reading a compressed log file. --- 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 ); + } } }