diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1997-04-14 20:25:38 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1997-04-14 20:25:38 +0000 |
commit | d44221fbb080f456ed7465523be9699f2fe1f98d (patch) | |
tree | 020a9d9878751d6c9265c3ce3b589611ca0a01a1 /bin/df | |
parent | 7cfcaae0f5cebec7f591b11ae9a4678947392857 (diff) |
make -h columns more compact
Diffstat (limited to 'bin/df')
-rw-r--r-- | bin/df/df.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/bin/df/df.c b/bin/df/df.c index d2a84dd0f74..9d10c2e28cf 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -1,4 +1,4 @@ -/* $OpenBSD: df.c,v 1.13 1997/04/14 17:38:22 kstailey Exp $ */ +/* $OpenBSD: df.c,v 1.14 1997/04/14 20:25:37 kstailey Exp $ */ /* $NetBSD: df.c,v 1.21.2.1 1995/11/01 00:06:11 jtc Exp $ */ /* @@ -49,7 +49,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: df.c,v 1.13 1997/04/14 17:38:22 kstailey Exp $"; +static char rcsid[] = "$OpenBSD: df.c,v 1.14 1997/04/14 20:25:37 kstailey Exp $"; #endif #endif /* not lint */ @@ -337,11 +337,11 @@ prthumanval(bytes) unit = unit_adjust(&bytes); if (bytes == 0) - (void)printf(" 0B "); + (void)printf(" 0B"); else if (bytes > 10) - (void)printf(" %5.0f%c ", bytes, "BKMGTPE"[unit]); + (void)printf(" %5.0f%c", bytes, "BKMGTPE"[unit]); else - (void)printf(" %5.1f%c ", bytes, "BKMGTPE"[unit]); + (void)printf(" %5.1f%c", bytes, "BKMGTPE"[unit]); } void @@ -381,14 +381,18 @@ prtstat(sfsp, maxwidth) if (hflag) { header = " Size"; headerlen = strlen(header); - } else if (kflag) { - blocksize = 1024; - header = "1K-blocks"; - headerlen = strlen(header); - } else - header = getbsize(&headerlen, &blocksize); - (void)printf("%-*.*s %s Used Avail Capacity", - maxwidth, maxwidth, "Filesystem", header); + (void)printf("%-*.*s %s Used Avail Capacity", + maxwidth, maxwidth, "Filesystem", header); + } else { + if (kflag) { + blocksize = 1024; + header = "1K-blocks"; + headerlen = strlen(header); + } else + header = getbsize(&headerlen, &blocksize); + (void)printf("%-*.*s %s Used Avail Capacity", + maxwidth, maxwidth, "Filesystem", header); + } if (iflag) (void)printf(" iused ifree %%iused"); (void)printf(" Mounted on\n"); |