From: Darold Gilles Date: Fri, 15 Jan 2016 13:04:18 +0000 (+0100) Subject: Fix wrong size/offset of log files that was breaking incremental mode. Thanks a lot... X-Git-Tag: v7.3~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ed0ea8b6b478179e67d709f85e1af71dac4eb0f;p=pgbadger Fix wrong size/offset of log files that was breaking incremental mode. Thanks a lot to CZAirwolf for the report and the help to find the problem. --- diff --git a/pgbadger b/pgbadger index a26da2a..cb729ee 100755 --- 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);