From: Darold Gilles Date: Fri, 15 Jan 2016 13:01:40 +0000 (+0100) Subject: Revert "Fix wrong size/offset of log files with unicode characters that was breaking... X-Git-Tag: v7.3~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a03f0cc9b76bfc8c2475e747a16f54ef913166c1;p=pgbadger Revert "Fix wrong size/offset of log files with unicode characters that was breaking incremental mode. Thanks a lot to CZAirwolf for the report and the help to find the problem." This reverts commit 8775053eb06a2c2bf8fd6995e1f42ea82e3c88b3. --- diff --git a/pgbadger b/pgbadger index 0c9f751..a26da2a 100755 --- a/pgbadger +++ b/pgbadger @@ -2284,10 +2284,6 @@ sub process_file $line =~ s/\r//; - # Set current size and offset - $cursize += bytes($line); - $current_offset += bytes($line); - # Start to exclude from parsing any desired lines if ($has_exclusion >= 0) { @@ -2297,6 +2293,9 @@ sub process_file next if ($ef); } + $cursize += length($line); + $current_offset += length($line); + chomp($line); $nlines++; next if (!$line); @@ -2881,12 +2880,6 @@ sub check_file_changed return (1, "reach the end of check_file_changed() with start date: $saved_date and file size: $totalsize") ; } -# Return real size of ascii and unicode string. -sub bytes($) -{ - use bytes; - return length shift; -} # Method used to check if we have already reached the last parsing position in incremental mode # This position should have been saved in the incremental file and read in the $last_parsed at