[pve-devel] r6478 - in pve-storage/pve2: . PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Aug 15 10:36:08 CEST 2011


Author: dietmar
Date: 2011-08-15 10:36:08 +0200 (Mon, 15 Aug 2011)
New Revision: 6478

Modified:
   pve-storage/pve2/ChangeLog
   pve-storage/pve2/PVE/Storage.pm
Log:
	* PVE/Storage.pm (parse_config): fix parser for files without
	newline at eof



Modified: pve-storage/pve2/ChangeLog
===================================================================
--- pve-storage/pve2/ChangeLog	2011-08-15 08:32:14 UTC (rev 6477)
+++ pve-storage/pve2/ChangeLog	2011-08-15 08:36:08 UTC (rev 6478)
@@ -1,3 +1,8 @@
+2011-08-15  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/Storage.pm (parse_config): fix parser for files without
+	newline at eof
+
 2011-08-12  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/Storage.pm (scan_usb): imp.

Modified: pve-storage/pve2/PVE/Storage.pm
===================================================================
--- pve-storage/pve2/PVE/Storage.pm	2011-08-15 08:32:14 UTC (rev 6477)
+++ pve-storage/pve2/PVE/Storage.pm	2011-08-15 08:36:08 UTC (rev 6478)
@@ -429,8 +429,7 @@
 
     my $pri = 0;
 
-    $raw = "" if !defined($raw);
-    while ($raw =~ s/^(.*)\n//) {
+    while ($raw && $raw =~ s/^(.*?)(\n|$)//) {
 	my $line = $1;
 
  	$sha1->add ($line); # compute digest
@@ -454,7 +453,7 @@
 		$ids->{$storeid}->{priority} = $pri++;
 	    }
 
-	    while ($raw =~ s/^(.*)\n//) {
+	    while ($raw && $raw =~ s/^(.*?)(\n|$)//) {
 		$line = $1;
 
 		next if $line =~ m/^\#/;



More information about the pve-devel mailing list