From: Will Budic Date: Fri, 21 Mar 2025 02:11:43 +0000 (+1100) Subject: Bug: Specific node not found was returning all nodes. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=21a552cc23b3033e5bb88be1fe873d15dd7d9655;p=PerlCNF.git Bug: Specific node not found was returning all nodes. --- diff --git a/system/modules/CNFNode.pm b/system/modules/CNFNode.pm index 00e5a9d..31c517b 100644 --- a/system/modules/CNFNode.pm +++ b/system/modules/CNFNode.pm @@ -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 }