aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-08-31 21:47:12 -0500
committerRob Landley <rob@landley.net>2015-08-31 21:47:12 -0500
commitb1b0399dc701f3c9af19a09164a4f536bc00eb2c (patch)
tree5b142e01cf45ca8ad44405bea8b6af40ea1c9fdb /toys
parent7cdb8af914777ec68086e9f4f9382168e4ce2ff2 (diff)
downloadtoybox-b1b0399dc701f3c9af19a09164a4f536bc00eb2c.tar.gz
ls -l user/group/security context should be left-aligned.
Right-aligned looks pretty good to me, but it's not what anyone else does.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/ls.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index f9511989..e46a5762 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -426,18 +426,18 @@ static void listfiles(int dirfd, struct dirtree *indir)
if (!(flags&FLAG_g)) {
if (flags&FLAG_n) sprintf(ss = thyme, "%u", (unsigned)st->st_uid);
else strwidth(ss = getusername(st->st_uid));
- printf(" %*s", (int)totals[3], ss);
+ printf(" %-*s", (int)totals[3], ss);
}
// print group
if (!(flags&FLAG_o)) {
if (flags&FLAG_n) sprintf(ss = thyme, "%u", (unsigned)st->st_gid);
else strwidth(ss = getgroupname(st->st_gid));
- printf(" %*s", (int)totals[4], ss);
+ printf(" %-*s", (int)totals[4], ss);
}
if (flags & FLAG_Z)
- printf(" %*s", -(int)totals[7], (char *)sort[next]->extra);
+ printf(" %-*s", -(int)totals[7], (char *)sort[next]->extra);
// print major/minor
if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
@@ -449,7 +449,7 @@ static void listfiles(int dirfd, struct dirtree *indir)
strftime(thyme, sizeof(thyme), "%F %H:%M", tm);
xprintf(" %s ", thyme);
} else if (flags & FLAG_Z)
- printf("%*s ", (int)totals[7], (char *)sort[next]->extra);
+ printf("%-*s ", (int)totals[7], (char *)sort[next]->extra);
if (flags & FLAG_color) {
color = color_from_mode(st->st_mode);