hdt: Display non-sequentials disks configurations
authorErwan Velu <erwanaliasr1@gmail.com>
Wed, 13 Apr 2011 18:42:38 +0000 (20:42 +0200)
committerErwan Velu <erwanaliasr1@gmail.com>
Wed, 13 Apr 2011 18:42:38 +0000 (20:42 +0200)
If the location of the disks wasn't sequential on the system, the menu
mode was missing some.

This commit fix ticket #46.

Thanks gerth for reporting.

com32/hdt/hdt-menu-disk.c

index b0b4a5a..6862e04 100644 (file)
@@ -243,12 +243,12 @@ void compute_disks(struct s_hdt_menu *menu, struct s_hardware *hardware)
     if (hardware->disks_count == 0)
        return;
 
-    for (int i = 0; i < hardware->disks_count; i++) {
-       if (!hardware->disk_info[i].cbios)
+    for (int drive = 0x80; drive < 0xff; drive++) {
+       if (!hardware->disk_info[drive - 0x80].cbios)
            continue;           /* Invalid geometry */
        compute_disk_module
            ((struct s_my_menu *)&(menu->disk_sub_menu), nb_sub_disk_menu,
-            hardware, i);
+            hardware, drive - 0x80);
        nb_sub_disk_menu++;
     }