From b1b0399dc701f3c9af19a09164a4f536bc00eb2c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 31 Aug 2015 21:47:12 -0500 Subject: 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. --- toys/posix/ls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toys') 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); -- cgit v1.2.3