]> granicus.if.org Git - pgbadger/commitdiff
Fix wrong size/offset of log files that was breaking incremental mode. Thanks a lot...
authorDarold Gilles <gilles@darold.net>
Fri, 15 Jan 2016 13:04:18 +0000 (14:04 +0100)
committerDarold Gilles <gilles@darold.net>
Fri, 15 Jan 2016 13:04:18 +0000 (14:04 +0100)
pgbadger

index a26da2a49fa684e5c9d76dcdf4f7b082ee657dbe..cb729ee15f085cb0223fffe935b24d71820b56b7 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -2282,6 +2282,11 @@ sub process_file
                        # We received a signal
                        last if ($terminate);
 
+                       # Get current size/offset in the log file
+                       $cursize += length($line);
+                       $current_offset += length($line);
+
+                       # Replace CR/LF by LF
                        $line =~ s/\r//;
 
                        # Start to exclude from parsing any desired lines
@@ -2293,9 +2298,6 @@ sub process_file
                                next if ($ef);
                        }
 
-                       $cursize += length($line);
-                       $current_offset += length($line);
-
                        chomp($line);
                        $nlines++;
                        next if (!$line);