fdisk: more readable code in read_extended_chain()

function                                             old     new   delta
get_boot                                            1426    1423      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko committed 2026-09-28 12:22:10 +02:00
1 parent ccf1e30fa2
commit 928b0384cf
1 file changed
+9 -7
+9 -7
View File
@@ -1040,13 +1040,15 @@ read_extended_chain(int ext)
remove:
for (i = 4; i < g_partitions; i++) {
struct pte *pe = &ptes[i];
if (get_nr_sects(pe->part_table) == 0
&& (g_partitions > 5 || ptes[4].part_table->sys_ind)
) {
printf("Omitting empty partition (%u)\n", i + 1);
delete_partition(i);
goto remove; // numbering changed
if (get_nr_sects(pe->part_table) == 0) {
if (g_partitions == 5 && is_cleared_partition(pe->part_table)) {
// empty extended partition
// (need to keep it for its sector buffer?)
} else {
printf("Omitting empty partition (%u)\n", i + 1);
delete_partition(i);
goto remove; // numbering changed
}
}
}
#endif