diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2000-03-29 01:53:02 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2000-03-29 01:53:02 +0000 |
commit | 02801a744dd9fd49e065334b9ab905b8e5d40e56 (patch) | |
tree | c3f23f68cdb7841502f6f378279c08916aea4a70 /sbin | |
parent | 50d8df2e015346b4bd4f1202913668a4c8741e0a (diff) |
sort partition type list vertically rather than across. ok weingart@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fdisk/part.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sbin/fdisk/part.c b/sbin/fdisk/part.c index 804bfd838d6..541640bb57e 100644 --- a/sbin/fdisk/part.c +++ b/sbin/fdisk/part.c @@ -1,4 +1,4 @@ -/* $OpenBSD: part.c,v 1.14 2000/01/08 04:51:16 deraadt Exp $ */ +/* $OpenBSD: part.c,v 1.15 2000/03/29 01:53:01 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -104,15 +104,24 @@ static struct part_type { void PRT_printall() { - int i; + int i, idrows; + + idrows = ((sizeof(part_types)/sizeof(struct part_type))+3)/4; printf("Choose from the following Partition id values:\n"); - for (i = 0; i < sizeof(part_types)/sizeof(struct part_type); i++) { - printf("%02X %s%s", part_types[i].type, - part_types[i].sname, (i+1) % 4 ? " " : "\n"); + for (i = 0; i < idrows; i++) { + printf("%02X %s %02X %s %02X %s" + , part_types[i ].type, part_types[i ].sname + , part_types[i+idrows ].type, part_types[i+idrows ].sname + , part_types[i+idrows*2].type, part_types[i+idrows*2].sname + ); + if ((i+idrows*3) < (sizeof(part_types)/sizeof(struct part_type))) { + printf(" %02X %s\n" + , part_types[i+idrows*3].type, part_types[i+idrows*3].sname ); + } + else + printf( "\n" ); } - if (i % 4) - printf("\n"); } char * |