]> lifelog.hopto.org Git - PerlCNF.git/commitdiff
Bug: Specific node not found was returning all nodes.
authorWill Budic <redacted>
Fri, 21 Mar 2025 02:11:43 +0000 (13:11 +1100)
committerWill Budic <redacted>
Fri, 21 Mar 2025 02:11:43 +0000 (13:11 +1100)
system/modules/CNFNode.pm

index 00e5a9de8a20197f3fcf766c678c5d8ecd828eda..31c517bce24afd874e8c31c60e025fdb7be3b156 100644 (file)
@@ -347,15 +347,16 @@ sub node {
        return $self->{$path} if exists $self->{$path};
        $ret = $self->{'@$'};
        if($ret){
+            my $found;
             foreach my $n(@$ret){
                 # if(ref($n) ne'CNFNode'){cluck "$n is illegal node hash element in [".$self->toPath()."]" }
                 # else{
                     if ($n->{'_'} eq $path){
-                        $ret = $n; last
+                        $found = $n; last
                     }
                 # }
             }
-            return $ret if $ret
+            return $found if $found
        }
       return EMPTY
     }