summaryrefslogtreecommitdiffstats
path: root/src/chgtype.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-08-06 09:20:13 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-08-06 09:20:13 +0200
commit6fd8c08ff65214b26b97073e6fb197a44270017f (patch)
tree82463476c58c12dac9b420b4952f808ee00cf080 /src/chgtype.c
parent41e90d881a239e44415204fb8687f33f5dc1b7ae (diff)
EFI GPT: when changing the partition type, select by default the current type
Diffstat (limited to 'src/chgtype.c')
-rw-r--r--src/chgtype.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/chgtype.c b/src/chgtype.c
index 006b052..a1e8658 100644
--- a/src/chgtype.c
+++ b/src/chgtype.c
@@ -276,6 +276,16 @@ static void gpt_change_part_type(const disk_t *disk_car, partition_t *partition)
wattrset(stdscr, A_REVERSE);
wprintw(stdscr, "[ Proceed ]");
wattroff(stdscr, A_REVERSE);
+ /* By default, select the current type */
+ for(i=0;gpt_sys_types[i].name!=NULL;i++)
+ {
+ if(guid_cmp(partition->part_type_gpt, gpt_sys_types[i].part_type)==0)
+ {
+ current_element_num=i;
+ while(current_element_num >= offset+3*INTER_CHGTYPE)
+ offset++;
+ }
+ }
while(1)
{
wmove(stdscr,5,0);