From 949328c9ee3581b2157c44fdb30018db88579587 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sat, 6 Jul 2002 11:04:58 +0000 Subject: the "each" trap got me :-( fixed (=> fixes the modules.conf missing many aliases) --- kernel/list_modules.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'kernel/list_modules.pm') diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm index 0da372abc..48929f95e 100644 --- a/kernel/list_modules.pm +++ b/kernel/list_modules.pm @@ -169,15 +169,13 @@ sub category2modules { sub module2category { my ($module) = @_; - my ($t1, $t2); - while (($t1, my $h) = each %l) { - while (($t2, my $l) = each %$h) { - $module eq $_ and goto found foreach @$l; - } + foreach my $t1 (keys %l) { + my $h = $l{$t1}; + foreach my $t2 (keys %$h) { + $module eq $_ and return "$t1/$t2" foreach @{$h->{$t2}}; + } } return; - found: - "$t1/$t2"; } sub sub_categories { -- cgit v1.2.1