From: Dobrica Pavlinusic Date: Thu, 27 Jan 2011 20:32:21 +0000 (+0100) Subject: fix parsing of gzip -l output X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=commitdiff_plain;h=40df4417247e8b3ec4e35770adbe9da62593e0e5;hp=f60ab5052143af5c1e85a556dddf9e58f1c2295e;ds=sidebyside fix parsing of gzip -l output --- 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 {