]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: fix add_attribute() function in perl lib
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 21 Feb 2011 14:41:01 +0000 (15:41 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:26 +0000 (14:43 +0200)
regress/scripts/functions.pm

index 9fb4416cde66a1314292254bcbf22ad8e8b5d525..46f0a69e23926a89f2435147d94f11f47181dd9e 100644 (file)
@@ -388,7 +388,7 @@ sub add_attribute
             $done=0;
         }
 
-        if ($l =~ /\Q$attr\E/i) {
+        if ($l =~ /^\s*\Q$attr\E/i) {
             if (!$obj || $cur_obj eq $obj) {
                 if (!$name || $cur_name eq $name) {
                     $l =~ s/\Q$attr\E\s*=\s*.+/$attr = $value/ig;
@@ -397,7 +397,7 @@ sub add_attribute
             }
         }
 
-        if ($l =~ /Name\s*=\s*"?([\w\d\.-]+)"?/i) {
+        if ($l =~ /^\s*Name\s*=\s*"?([\w\d\.-]+)"?/i) {
             $cur_name = $1;
         }