summaryrefslogtreecommitdiff
path: root/com32/modules
diff options
context:
space:
mode:
authorMichal Soltys <soltys@ziu.info>2010-07-30 08:46:06 +0200
committerH. Peter Anvin <hpa@zytor.com>2010-07-30 10:14:24 -0700
commit8afab2175c3df81fdc532930585003c712a219f1 (patch)
treec042849fb3ed43e3bb84ce09936116b7b01b436b /com32/modules
parentdc43640b23ba92fca3ee3ea9aeac0da7c01e2c9d (diff)
downloadsyslinux-8afab2175c3df81fdc532930585003c712a219f1.tar.gz
chain.c: fix public index value in mbr and gpt iterators
mbr and gpt iterators skip empty / non-data partitions properly, but don't update publicly visible index. With this patch, such partitions are counted as well. Signed-off-by: Michal Soltys <soltys@ziu.info> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/modules')
-rw-r--r--com32/modules/chain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 5078ed3c..60e3abce 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -335,8 +335,8 @@ static struct disk_part_iter *next_mbr_part(struct disk_part_iter *part)
/* Update parameters to reflect this new partition. Re-use iterator */
part->lba_data = table[part->private.mbr_index].start_lba;
- dprintf("Partition %d primary lba %u\n", part->index, part->lba_data);
- part->index++;
+ dprintf("Partition %d primary lba %u\n", part->private.mbr_index, part->lba_data);
+ part->index = part->private.mbr_index + 1;
part->record = table + part->private.mbr_index;
return part;
@@ -369,7 +369,7 @@ static struct disk_part_iter *next_gpt_part(struct disk_part_iter *part)
part->private.gpt.part_guid = &gpt_part->uid;
part->private.gpt.part_label = gpt_part->name;
/* Update our index */
- part->index++;
+ part->index = part->private.gpt.index + 1;
#ifdef DEBUG
disk_gpt_part_dump(gpt_part);
#endif