]> granicus.if.org Git - pgbadger/commitdiff
Fix again last patch
authorGilles Darold <gilles.darold@dalibo.com>
Wed, 15 Feb 2017 18:04:01 +0000 (19:04 +0100)
committerGilles Darold <gilles.darold@dalibo.com>
Wed, 15 Feb 2017 18:04:01 +0000 (19:04 +0100)
pgbadger

index a6c60d18f660eb598b1b596a7320c9fea3736b3c..b88d7d5a68f9225635645f4271689b9e0112cc57 100644 (file)
--- a/pgbadger
+++ b/pgbadger
@@ -13691,16 +13691,17 @@ sub autodetect_format
        my $nline  = 0;
        my $fmt    = '';
        my %ident_name = ();
+       my $fltf;
 
        if (!$remote_host) {
                localdie("FATAL: when looking for log file format, can't open file $file, $!\n") unless(open(TESTFILE, $file));
-               my $fltf = <TESTFILE>;
+               $fltf = <TESTFILE>;
                close(TESTFILE);
+       }
 
-               # is file in binary format ?
-               if ( $fltf =~ /^pst\d/ ) {
-                       $fmt = 'binary';
-               }
+       # is file in binary format ?
+       if ( $fltf =~ /^pst\d/ ) {
+               $fmt = 'binary';
        }
        else { # try to detect syslogs, stderr, csv or pgbouncer format
                my ($tfile, $totalsize) = &get_log_file($file, $remote_host);