[pve-devel] r5529 - pve-common/trunk/data/PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Feb 15 13:33:52 CET 2011


Author: dietmar
Date: 2011-02-15 13:33:51 +0100 (Tue, 15 Feb 2011)
New Revision: 5529

Modified:
   pve-common/trunk/data/PVE/Tools.pm
Log:
bug fix


Modified: pve-common/trunk/data/PVE/Tools.pm
===================================================================
--- pve-common/trunk/data/PVE/Tools.pm	2011-02-15 12:21:32 UTC (rev 5528)
+++ pve-common/trunk/data/PVE/Tools.pm	2011-02-15 12:33:51 UTC (rev 5529)
@@ -349,10 +349,10 @@
     my ($tmpl, $data) = @_;
 
     my $res = '';
-    while ($tmpl =~ m/([^{]+){([^}]+)}/g) {
-	$res .= $1 . ($data->{$2} || '-');
+    while ($tmpl =~ m/([^{]+)?({([^}]+)})?/g) {
+	$res .= $1 if $1;
+	$res .= ($data->{$3} || '-') if $2;
     }
-
     return $res;
 }
 




More information about the pve-devel mailing list