From: Karel Zak Date: Tue, 17 Sep 2013 13:58:09 +0000 (+0200) Subject: fdisk: fix 'r' in BSD menu X-Git-Tag: v2.24-rc1~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b572966747ab6b51783c70982840acefb6e6f178;p=thirdparty%2Futil-linux.git fdisk: fix 'r' in BSD menu Signed-off-by: Karel Zak --- diff --git a/fdisks/fdisk-menu.c b/fdisks/fdisk-menu.c index 7251307245..d842b8138b 100644 --- a/fdisks/fdisk-menu.c +++ b/fdisks/fdisk-menu.c @@ -108,6 +108,7 @@ struct menu menu_generic = { MENU_ENT_L('w', N_("write table to disk"), FDISK_DISKLABEL_BSD), MENU_BENT ('q', N_("quit without saving changes")), MENU_XENT ('r', N_("return to main menu")), + MENU_ENT_L('r', N_("return to main menu"), FDISK_DISKLABEL_BSD), { 0, NULL } } @@ -483,16 +484,13 @@ static int generic_menu_cb(struct fdisk_context **cxt0, case 'r': /* return from nested PT (e.g. BSD) */ if (cxt->parent) { - struct fdisk_context *tmp = cxt->parent; + *cxt0 = cxt->parent; fdisk_info(cxt, _("Leaving nested disk label.")); fdisk_free_context(cxt); - cxt = tmp; + cxt = *cxt0; } break; - default: - fdisk_warnx(cxt, _("%c: unimplemented command"), ent->key); - break; } return rc;