diff options
Diffstat (limited to 'tests/getpart.pm')
-rw-r--r-- | tests/getpart.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/getpart.pm b/tests/getpart.pm index d28800088..7449be983 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -7,6 +7,9 @@ my $warning=0; my $trace=0; sub getpartattr { + # if $part is undefined (ie only one argument) then + # return the attributes of the section + my ($section, $part)=@_; my %hash; @@ -19,7 +22,9 @@ sub getpartattr { if(!$inside && ($_ =~ /^ *\<$section/)) { $inside++; } - elsif((1 ==$inside) && ($_ =~ /^ *\<$part([^>]*)/)) { + if((1 ==$inside) && ( ($_ =~ /^ *\<$part([^>]*)/) || + !(defined($part)) ) + ) { $inside++; my $attr=$1; my @p=split("[ \t]", $attr); |