From 2a52d51c92dd636b40aa40d31b6859223bcec383 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 17 Aug 2004 09:12:09 +0000 Subject: cleanly handle the case when {pt_type} is 0 --- perl-install/fs/type.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm index 6eb7e6c12..137731c4b 100644 --- a/perl-install/fs/type.pm +++ b/perl-install/fs/type.pm @@ -194,7 +194,8 @@ sub part2type_name { my ($part) = @_; my @names = keys %type_name2fs_type; - if (my $pt_type = $part->{pt_type} || $part->{fs_type} && $fs_type2pt_type{$part->{fs_type}}) { + my $pt_type = defined $part->{pt_type} ? $part->{pt_type} : $part->{fs_type} && $fs_type2pt_type{$part->{fs_type}}; + if (defined $pt_type) { @names = grep { $pt_type eq $type_name2pt_type{$_} } @names; } if (my $fs_type = $part->{fs_type} || $part->{pt_type} && $pt_type2fs_type{$part->{pt_type}}) { -- cgit v1.2.1