aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-09-07 21:36:28 -0700
committerRob Landley <rob@landley.net>2019-09-09 23:48:50 -0500
commitfb872879a7d7c4c9d184ec7e4b255ea1a85e124e (patch)
treed179ed7853c3bdff2a40a41d5eb9595ace5256af /toys/posix
parent1558f3455f1f5f22e25b25284a6a99c698a7fa23 (diff)
downloadtoybox-fb872879a7d7c4c9d184ec7e4b255ea1a85e124e.tar.gz
ls: fix spacing of -lZ and --full-time.
Two more spacing bugs here, one before the security context for -Z, and one after the size with --full-time. Before: $ ./toybox ls -lZ --full-time Config. -rw-r----- 1 enh primarygroup? 56162019-09-07 21:09:32.892215100 -0700 Config.in After: $ ./toybox ls -lZ --full-time Config. -rw-r----- 1 enh primarygroup ? 5616 2019-09-07 21:09:32.892215100 -0700 Config.in
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/ls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index 25b77ad7..1640ea70 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -466,8 +466,8 @@ static void listfiles(int dirfd, struct dirtree *indir)
crunch_qb);
}
}
- if (flags & FLAG_Z)
- printf("%-*s ", -(int)totals[7], (char *)sort[next]->extra);
+ if (FLAG(Z))
+ printf(" %-*s "+!FLAG(l), -(int)totals[7], (char *)sort[next]->extra);
if (flags & (FLAG_l|FLAG_o|FLAG_n|FLAG_g)) {
struct tm *tm;
@@ -483,7 +483,7 @@ static void listfiles(int dirfd, struct dirtree *indir)
// print time, always in --time-style=long-iso
tm = localtime(&(st->st_mtime));
- strftime(tmp, sizeof(tmp), "%F %H:%M", tm);
+ strftime(tmp, sizeof(tmp), " %F %H:%M", tm);
if (TT.l>1) {
char *s = tmp+strlen(tmp);