summaryrefslogtreecommitdiffstats
path: root/bin/ls/print.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2007-05-07 18:39:28 +0000
committermillert <millert@openbsd.org>2007-05-07 18:39:28 +0000
commit947f7ba6d09cf9ec59f4c39ac44b7aa8001b8eac (patch)
treeb07cdf7e160cca8d80b4afede02d0afeaadb799e /bin/ls/print.c
parentBump crypto buffer logging (before crypto/after crypto) to level 70 from (diff)
downloadwireguard-openbsd-947f7ba6d09cf9ec59f4c39ac44b7aa8001b8eac.tar.xz
wireguard-openbsd-947f7ba6d09cf9ec59f4c39ac44b7aa8001b8eac.zip
Change the -g flag from a no-op to be POSIX conforming. We allow the
-l flag to override -g regardless of its position on the command line for backwards compat with 4.3BSD. From NetBSD. OK jmc@, tom@, sobrado@
Diffstat (limited to 'bin/ls/print.c')
-rw-r--r--bin/ls/print.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c
index 44f49df0c6f..e5fac1b56b2 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.24 2005/06/15 17:47:17 millert Exp $ */
+/* $OpenBSD: print.c,v 1.25 2007/05/07 18:39:28 millert Exp $ */
/* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.5 (Berkeley) 7/28/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.24 2005/06/15 17:47:17 millert Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.25 2007/05/07 18:39:28 millert Exp $";
#endif
#endif /* not lint */
@@ -104,9 +104,10 @@ printlong(DISPLAY *dp)
dp->s_block, howmany(sp->st_blocks, blocksize));
(void)strmode(sp->st_mode, buf);
np = p->fts_pointer;
- (void)printf("%s %*u %-*s %-*s ", buf, dp->s_nlink,
- sp->st_nlink, dp->s_user, np->user, dp->s_group,
- np->group);
+ (void)printf("%s %*u ", buf, dp->s_nlink, sp->st_nlink);
+ if (!f_grouponly)
+ (void)printf("%-*s ", dp->s_user, np->user);
+ (void)printf("%-*s ", dp->s_group, np->group);
if (f_flags)
(void)printf("%-*s ", dp->s_flags, np->flags);
if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode))