diff options
| author | Karel Zak <kzak@redhat.com> | 2013-07-10 14:17:58 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2013-09-16 16:47:06 +0200 |
| commit | a47fec81b2a9eae2712da86c75db27cf76fae4b4 (patch) | |
| tree | 8612cb31bd4891e8e49617d4014c698e66510958 /fdisks/fdisk.c | |
| parent | 296b856d4282bfa20c581814e0db18031cb61960 (diff) | |
| download | util-linux-a47fec81b2a9eae2712da86c75db27cf76fae4b4.tar.gz | |
fdisk: allow to exchange context pointer in menu callbacks
... to make it possible to switch to nested contexts (nested partition
tables).
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk.c')
| -rw-r--r-- | fdisks/fdisk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c index 0ca88894..f95266bd 100644 --- a/fdisks/fdisk.c +++ b/fdisks/fdisk.c @@ -381,7 +381,7 @@ expert_command_prompt(struct fdisk_context *cxt) while(1) { assert(cxt->label); - c = process_fdisk_menu(cxt); + c = process_fdisk_menu(&cxt); if (c <= 0) continue; @@ -512,7 +512,7 @@ static void command_prompt(struct fdisk_context *cxt) while (1) { assert(cxt->label); - c = process_fdisk_menu(cxt); + c = process_fdisk_menu(&cxt); if (c <= 0) continue; @@ -588,6 +588,14 @@ static void command_prompt(struct fdisk_context *cxt) case 'x': expert_command_prompt(cxt); break; + case 'r': + if (cxt->parent) { + struct fdisk_context *tmp = cxt->parent; + + fdisk_free_context(cxt); + cxt = tmp; + } + break; default: unknown_command(c); } |
