From 40df4417247e8b3ec4e35770adbe9da62593e0e5 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 27 Jan 2011 21:32:21 +0100 Subject: [PATCH 1/1] fix parsing of gzip -l output --- bin/BackupPC_ASA_PostArchive_Update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/BackupPC_ASA_PostArchive_Update b/bin/BackupPC_ASA_PostArchive_Update index 3a79676..11de07e 100755 --- a/bin/BackupPC_ASA_PostArchive_Update +++ b/bin/BackupPC_ASA_PostArchive_Update @@ -176,13 +176,13 @@ sub check_archive { } open(my $gzip, $Conf{GzipPath}." -l $filename |") || die "can't gzip -l $filename: $!"; + local $/ = undef; my $line = <$gzip>; - chomp($line); - $line = <$gzip> if ($line =~ /^\s+compressed/); + close($gzip); my ($comp, $uncomp) = (0,0); - if ($line =~ m/^\s+(\d+)\s+(\d+)\s+\d+\.\d+/) { + if ($line =~ m/\s+(\d+)\s+(\d+)\s+\d+\.\d+/s) { if (wantarray) { return [ $1, $2 ]; } else { -- 2.20.1