From: Darold Gilles Date: Mon, 11 Mar 2013 11:24:35 +0000 (+0100) Subject: Fix issue with logs read from stdin. Thanks to hubert depesz lubaczewski for the... X-Git-Tag: v3.2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fea0cfb8a2f21fccc9e5d86d86e798e3cd001c92;p=pgbadger Fix issue with logs read from stdin. Thanks to hubert depesz lubaczewski for the report. --- diff --git a/pgbadger b/pgbadger index b5fb43a..a8c911f 100755 --- 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$/)) {