]> granicus.if.org Git - pgbadger/commitdiff
Fix issue with logs read from stdin. Thanks to hubert depesz lubaczewski for the...
authorDarold Gilles <gilles@darold.net>
Mon, 11 Mar 2013 11:24:35 +0000 (12:24 +0100)
committerDarold Gilles <gilles@darold.net>
Mon, 11 Mar 2013 11:24:35 +0000 (12:24 +0100)
pgbadger

index b5fb43ac2ced62044ca20f97911fcdfdee363d30..a8c911f0a87730fdaea4805f232b5b32c4dd06bf 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -6097,7 +6097,8 @@ sub get_log_file
 
        # Open a file handle
        if ($logf !~ /\.(gz|bz2|zip)/i) {
-               open($lfile,"<",$logf) || die "FATAL: cannot read log file $logf. $!\n";
+               open($lfile, $logf) || die "FATAL: cannot read log file $logf. $!\n";
+               $totalsize = 0 if ($lfile eq '-');
        } else {
                my $uncompress = $zcat;
                if (($logf =~ /\.bz2/i) && ($zcat =~ /^$zcat_cmd$/)) {