From: Francesco Cosoleto Date: Wed, 10 Feb 2010 11:42:26 +0000 (+0100) Subject: cfdisk: set '[Quit]' as default menu item on first run instead of '[Bootable]'. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad83f970362c96cdcaa237780212480e6925f919;p=util-linux cfdisk: set '[Quit]' as default menu item on first run instead of '[Bootable]'. Signed-off-by: Francesco Cosoleto --- diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c index eec16893..a3a14d8a 100644 --- a/fdisk/cfdisk.c +++ b/fdisk/cfdisk.c @@ -2742,6 +2742,7 @@ static void do_curses_fdisk(void) { int done = FALSE; char command; + int is_first_run = TRUE; static struct MenuItem menuMain[] = { { 'b', N_("Bootable"), N_("Toggle bootable flag of the current partition") }, @@ -2788,12 +2789,13 @@ do_curses_fdisk(void) { } else if (p_info[cur_part].id > 0) { s = ((opentype == O_RDWR) ? "bdhmpqtuW" : "bdhmpqtu"); command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10, - s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 0); + s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, is_first_run ? 7 : 0); } else { s = ((opentype == O_RDWR) ? "hpquW" : "hpqu"); command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10, s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 0); } + is_first_run = FALSE; switch ( command ) { case 'B': case 'b':