[PATCH 1/2] cfdisk: set '[Quit]' as default menu item on first run instead of '[Bootable]'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Francesco Cosoleto <cosoleto@xxxxxxxxx>
---
 fdisk/cfdisk.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index eaf766c..f871cc4 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -2584,6 +2584,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") },
@@ -2630,12 +2631,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':
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux