From 75ebbd1571c85a06c0f4767beb7c20a19068f0b6 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 8 Oct 2016 17:30:50 -0500 Subject: Teach ps -w not to truncate any fields. --- toys/posix/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/posix') diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 7a8327f3..cb57ecf2 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -566,7 +566,7 @@ static void show_ps(struct carveup *tb) abslen = abs(field->len); sign = field->len<0 ? -1 : 1; olen = strlen(out); - if (field->which<=PS_BIT && olen>abslen) { + if ((field->which<=PS_BIT || (toys.optflags&FLAG_w)) && olen>abslen) { // overflow but remember by how much extra += olen-abslen; abslen = olen; -- cgit v1.2.3