From 9197c0ae1d5206f74284018c78538a38375af3c1 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 16 Feb 2019 16:24:09 -0600 Subject: Disallow -o "" in top. --- toys/posix/ps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 2e5338ea..279a947a 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -1448,11 +1448,12 @@ static void top_common( } plist[2], *plold, *plnew, old, new, mix; char scratch[16], *pos, *cpufields[] = {"user", "nice", "sys", "idle", "iow", "irq", "sirq", "host"}; - unsigned tock = 0; int i, lines, topoff = 0, done = 0; char stdout_buf[BUFSIZ]; + if (!TT.fields) perror_exit("no -o"); + // Avoid flicker and hide the cursor in interactive mode. if (!FLAG(b)) { setbuf(stdout, stdout_buf); -- cgit v1.2.3