summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2010-11-06 00:46:57 +0100
committerDenys Vlasenko2010-11-06 00:46:57 +0100
commit4909fec73eb3d4bbd2af17c2fb891b75291265e7 (patch)
tree59061ecb0fe61e8d68e4d39989847d937f38460c
parent3bbfb58bec18990a2ee93f31ea1ee2fd19c4d9b2 (diff)
downloadbusybox-4909fec73eb3d4bbd2af17c2fb891b75291265e7.zip
busybox-4909fec73eb3d4bbd2af17c2fb891b75291265e7.tar.gz
ls: fix -lg to show group (was showing user)
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--coreutils/ls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index e69f1af..72f58c2 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -182,7 +182,7 @@ static const unsigned opt_flags[] = {
LIST_INO, /* i */
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
LIST_SHORT | STYLE_SINGLE, /* 1 */
- 0, /* g (don't show group) - handled via OPT_g */
+ 0, /* g (don't show owner) - handled via OPT_g */
LIST_ID_NUMERIC, /* n */
LIST_BLOCKS, /* s */
DISP_ROWS, /* x */
@@ -620,7 +620,7 @@ static NOINLINE unsigned list_single(const struct dnode *dn)
if (all_fmt & LIST_ID_NAME) {
if (option_mask32 & OPT_g) {
column += printf("%-8.8s ",
- get_cached_username(dn->dstat.st_uid));
+ get_cached_groupname(dn->dstat.st_gid));
} else {
column += printf("%-8.8s %-8.8s ",
get_cached_username(dn->dstat.st_uid),
@@ -630,7 +630,7 @@ static NOINLINE unsigned list_single(const struct dnode *dn)
#endif
if (all_fmt & LIST_ID_NUMERIC) {
if (option_mask32 & OPT_g)
- column += printf("%-8u ", (int) dn->dstat.st_uid);
+ column += printf("%-8u ", (int) dn->dstat.st_gid);
else
column += printf("%-8u %-8u ",
(int) dn->dstat.st_uid,