]> git.proxmox.com Git - pve-common.git/commitdiff
file_read_firstline: avoid warning with empty files
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 2 Oct 2012 06:05:33 +0000 (08:05 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 2 Oct 2012 06:05:33 +0000 (08:05 +0200)
Makefile
data/PVE/Tools.pm
debian/changelog

index ad670b85f50d254a3684b4570d4ffa06e7cea855..b7dfb0f7a1038e8e6a75a878a9fa6a2b0705cb28 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 RELEASE=2.2
 
 VERSION=1.0
-PKGREL=33
+PKGREL=34
 
 PACKAGE=libpve-common-perl
 
index 4f62cd7d2c137911a6241b33d605a09d357107c4..f962da50bda194311e68f01779480c14abe96bd4 100644 (file)
@@ -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;
 }
index c8bf6d0a311acbd4d809a1b8b62f807bb0bf7add..94b19188ba55878391a8b49af40f8f5af02324db 100644 (file)
@@ -1,3 +1,9 @@
+libpve-common-perl (1.0-34) unstable; urgency=low
+
+  * file_read_firstline: avoid warning with empty files
+
+ -- Proxmox Support Team <support@proxmox.com>  Tue, 02 Oct 2012 08:05:10 +0200
+
 libpve-common-perl (1.0-33) unstable; urgency=low
 
   * fix run_command: restore umask correctly