]> granicus.if.org Git - pgbadger/commitdiff
Revert "Fix wrong size/offset of log files with unicode characters that was breaking...
authorDarold Gilles <gilles@darold.net>
Fri, 15 Jan 2016 13:01:40 +0000 (14:01 +0100)
committerDarold Gilles <gilles@darold.net>
Fri, 15 Jan 2016 13:01:40 +0000 (14:01 +0100)
This reverts commit 8775053eb06a2c2bf8fd6995e1f42ea82e3c88b3.

pgbadger

index 0c9f751425c921eabcfa94b40070bf6f496b8dbd..a26da2a49fa684e5c9d76dcdf4f7b082ee657dbe 100755 (executable)
--- 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