aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-02-20 22:40:10 -0600
committerRob Landley <rob@landley.net>2017-02-20 22:40:10 -0600
commita36264ffcbe39d92ece08d05f204acd6085170bd (patch)
tree0ae95bfdcb9948c71520970eb6272032c33a1a7c
parentfd5687662c581b9f94a9076a3cd7436560682cf2 (diff)
downloadtoybox-a36264ffcbe39d92ece08d05f204acd6085170bd.tar.gz
If the last ps field is left justified, it extends to the width of the screen.
(Recent "show + for last char when truncated" change broke that, putting it back.)
-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 bcf1e714..41ddf6a4 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -585,7 +585,10 @@ static void show_ps(void *p)
pad *= sign;
// If last field is left justified, no trailing spaces.
- if (!field->next && sign<0) pad = -1;
+ if (!field->next && sign<0) {
+ pad = -1;
+ len = width;
+ }
// If we truncated a left-justified field, show + instead of last char
if (olen>len && len>1 && sign<0) {