From 2009d0af7081bb42e35db6ff4eb4e39e7474c10c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 8 Jun 2016 22:53:51 -0500 Subject: Fix ps bug, last field wasn't expanding to width. (Still fixing the fallout from that "Don't truncate number fields" logic rewrite.) --- toys/posix/ps.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toys') 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); -- cgit v1.2.3