aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ps.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-06-08 22:53:51 -0500
committerRob Landley <rob@landley.net>2016-06-08 22:53:51 -0500
commit2009d0af7081bb42e35db6ff4eb4e39e7474c10c (patch)
tree8e2ef22418f523c0701a7a2243ab0dc1bba3380f /toys/posix/ps.c
parente02e41373ea3288b023e22629764ec02ce4aaee1 (diff)
downloadtoybox-2009d0af7081bb42e35db6ff4eb4e39e7474c10c.tar.gz
Fix ps bug, last field wasn't expanding to width.
(Still fixing the fallout from that "Don't truncate number fields" logic rewrite.)
Diffstat (limited to 'toys/posix/ps.c')
-rw-r--r--toys/posix/ps.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 6a9676c0..4c66bcd6 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -593,7 +593,10 @@ static void show_ps(struct carveup *tb)
len = pad = abslen;
pad *= sign;
// If last field is left justified, no trailing spaces.
- if (!field->next && sign<0) pad = 0;
+ if (!field->next && sign<0) {
+ pad = 0;
+ len = width;
+ }
if (TT.tty) width -= draw_trim(out, pad, len);
else width -= printf("%*.*s", pad, len, out);