From bfcc35f8882cb0fbd5c965a43ccd8103e38ed5e6 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 16 Nov 2004 10:14:11 +0000 Subject: create isEmpty() and use it instead of simply testing {pt_type}, since {pt_type} can be undef whereas {fs_type} is set --- perl-install/partition_table.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'perl-install/partition_table.pm') diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 1d5e87e47..88bbcfd74 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -227,7 +227,7 @@ sub get_normal_parts_and_holes { } sort { $a->{start} <=> $b->{start} } grep { !isWholedisk($_) } get_normal_parts($hd); push @l, { start => $start, size => $last - $start, %$minimal_hole }; - grep { $_->{pt_type} || $_->{size} >= $hd->cylinder_size } @l; + grep { !isEmpty($_) || $_->{size} >= $hd->cylinder_size } @l; } sub read_one($$) { @@ -264,8 +264,8 @@ sub read_one($$) { } my @extended = $hd->hasExtended ? grep { isExtended($_) } @$pt : (); - my @normal = grep { $_->{size} && $_->{pt_type} && !isExtended($_) } @$pt; - my $nb_special_empty = int(grep { $_->{size} && $_->{pt_type} == 0 } @$pt); + my @normal = grep { $_->{size} && !isEmpty($_) && !isExtended($_) } @$pt; + my $nb_special_empty = int(grep { $_->{size} && isEmpty($_) } @$pt); @extended > 1 and die "more than one extended partition"; -- cgit v1.2.1