From: krw Date: Wed, 29 Mar 2000 01:53:01 +0000 (+0000) Subject: sort partition type list vertically rather than across. ok weingart@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d20bdfc6674c07485daa7e85e87f25d03eab4a53;p=openbsd sort partition type list vertically rather than across. ok weingart@ --- 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 *