From: Dietmar Maurer Date: Tue, 2 Oct 2012 06:05:33 +0000 (+0200) Subject: file_read_firstline: avoid warning with empty files X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=88955a2e691484a69c2fe140510b3a03768db2b2;ds=sidebyside file_read_firstline: avoid warning with empty files --- diff --git a/Makefile b/Makefile index ad670b8..b7dfb0f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ RELEASE=2.2 VERSION=1.0 -PKGREL=33 +PKGREL=34 PACKAGE=libpve-common-perl diff --git a/data/PVE/Tools.pm b/data/PVE/Tools.pm index 4f62cd7..f962da5 100644 --- a/data/PVE/Tools.pm +++ b/data/PVE/Tools.pm @@ -173,7 +173,7 @@ sub file_read_firstline { my $fh = IO::File->new ($filename, "r"); return undef if !$fh; my $res = <$fh>; - chomp $res; + chomp $res if $res; $fh->close; return $res; } diff --git a/debian/changelog b/debian/changelog index c8bf6d0..94b1918 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libpve-common-perl (1.0-34) unstable; urgency=low + + * file_read_firstline: avoid warning with empty files + + -- Proxmox Support Team Tue, 02 Oct 2012 08:05:10 +0200 + libpve-common-perl (1.0-33) unstable; urgency=low * fix run_command: restore umask correctly