For -ls output, change field widths to allow inodes up to 9,999,999 and

file sizes up to 999,999,999 bytes (and 999,999 blocks) without wobbly
lines.  Also change device minor/major to be 3/5 digits (current maximum
is 4/7 digits - the 3/5 split is arbitary).
This commit is contained in:
simonb 1998-10-27 04:53:03 +00:00
parent 2fd1cb5817
commit 1f00456a27
1 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ls.c,v 1.11 1998/10/14 00:50:59 wsanchez Exp $ */
/* $NetBSD: ls.c,v 1.12 1998/10/27 04:53:03 simonb Exp $ */
/*
* Copyright (c) 1989, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)ls.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: ls.c,v 1.11 1998/10/14 00:50:59 wsanchez Exp $");
__RCSID("$NetBSD: ls.c,v 1.12 1998/10/27 04:53:03 simonb Exp $");
#endif
#endif /* not lint */
@ -73,7 +73,7 @@ printlong(name, accpath, sb)
{
char modep[15];
(void)printf("%6lu %4qd ", (u_long)sb->st_ino,
(void)printf("%7lu %6qd ", (u_long)sb->st_ino,
(long long)sb->st_blocks);
(void)strmode(sb->st_mode, modep);
(void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, UT_NAMESIZE,
@ -81,10 +81,10 @@ printlong(name, accpath, sb)
group_from_gid(sb->st_gid, 0));
if (S_ISCHR(sb->st_mode) || S_ISBLK(sb->st_mode))
(void)printf("%3d, %3d ", major(sb->st_rdev),
(void)printf("%3d,%5d ", major(sb->st_rdev),
minor(sb->st_rdev));
else
(void)printf("%8qd ", (long long)sb->st_size);
(void)printf("%9qd ", (long long)sb->st_size);
printtime(sb->st_mtime);
(void)printf("%s", name);
if (S_ISLNK(sb->st_mode))