diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-19 23:44:48 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-19 23:44:48 +0000 |
commit | dd1db2c8dfcf0099cded29c31b58f7ffb7e44ce0 (patch) | |
tree | 3d402d06beeeaf6e1bfab06918c409857580d41a /sbin/pdisk/pdisk.c | |
parent | a341238b1ebe807eb1b02ee1a2cd8e8192e9cf27 (diff) |
Simplify the main command switch, eliminating a couple of /* fall
through */ and two variables by simply calling the target functions
with the different parameters.
Diffstat (limited to 'sbin/pdisk/pdisk.c')
-rw-r--r-- | sbin/pdisk/pdisk.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index 99300abf092..ff34e266fd5 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdisk.c,v 1.53 2016/01/19 23:33:18 krw Exp $ */ +/* $OpenBSD: pdisk.c,v 1.54 2016/01/19 23:44:47 krw Exp $ */ /* * pdisk - an editor for Apple format partition tables @@ -141,7 +141,7 @@ void edit(char *name) { struct partition_map_header *map; - int command, order, get_type, valid_file; + int command, valid_file; map = open_partition_map(name, &valid_file); if (!valid_file) { @@ -151,8 +151,6 @@ edit(char *name) while (get_command("Command (? for help): ", first_get, &command)) { first_get = 0; - order = 1; - get_type = 0; switch (command) { case '?': @@ -182,10 +180,10 @@ edit(char *name) } break; case 'P': - order = 0; - /* fall through */ + dump_partition_map(map, 0); + break; case 'p': - dump_partition_map(map, order); + dump_partition_map(map, 1); break; case 'Q': case 'q': @@ -203,10 +201,10 @@ edit(char *name) map = init_partition_map(name, map); break; case 'C': - get_type = 1; - /* fall through */ + do_create_partition(map, 1); + break; case 'c': - do_create_partition(map, get_type); + do_create_partition(map, 0); break; case 'N': case 'n': |