]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Completly disable the progress indicator when reading a compressed log file.
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 14 Jul 2010 19:43:13 +0000 (19:43 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 14 Jul 2010 19:43:13 +0000 (19:43 +0000)
log.c

diff --git a/log.c b/log.c
index 19360412e5b091b73125e05d78baa0ba872b71e6..e3ee7294d59d4d7af91a35d4e8e1b123d19b59c8 100644 (file)
--- 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 );
+         }
       }
    }