]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/functions.pm
regress: fix add_attribute() function in perl lib
[bacula/bacula] / 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;
         }