summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-02-05 07:55:37 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-02-05 07:55:37 +0000
commit473c8f569c75a1b924d6f429f156f886e61515f8 (patch)
tree19faf4e08459dccad505b58b76e0e1c51d88fac8
parentf7acb44049f82b1ee55fde44df8d2c9d0308eaa5 (diff)
short names by default; danh@wzrd.com
-rw-r--r--usr.bin/find/ls.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c
index 1d4bc31f7c9..c8e2163622e 100644
--- a/usr.bin/find/ls.c
+++ b/usr.bin/find/ls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ls.c,v 1.6 1998/10/04 01:05:25 millert Exp $ */
+/* $OpenBSD: ls.c,v 1.7 2001/02/05 07:55:36 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)ls.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: ls.c,v 1.6 1998/10/04 01:05:25 millert Exp $";
+static char rcsid[] = "$OpenBSD: ls.c,v 1.7 2001/02/05 07:55:36 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -55,6 +55,8 @@ static char rcsid[] = "$OpenBSD: ls.c,v 1.6 1998/10/04 01:05:25 millert Exp $";
static void printlink __P((char *));
static void printtime __P((time_t));
+#define NAME_WIDTH 8
+
void
printlong(name, accpath, sb)
char *name; /* filename to print */
@@ -65,9 +67,9 @@ printlong(name, accpath, sb)
(void)printf("%6u %4qd ", sb->st_ino, sb->st_blocks);
(void)strmode(sb->st_mode, modep);
- (void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, UT_NAMESIZE,
- user_from_uid(sb->st_uid, 0), UT_NAMESIZE,
- group_from_gid(sb->st_gid, 0));
+ (void)printf("%s %3u %-*.*s %-*.*s ", modep, sb->st_nlink,
+ NAME_WIDTH, UT_NAMESIZE, user_from_uid(sb->st_uid, 0),
+ NAME_WIDTH, UT_NAMESIZE, 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),