From b2853ed1170ff900100fa69fee5a8dfd728bd120 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Thu, 3 Sep 2015 00:00:00 -0500 Subject: [PATCH] top: do not co-mingle strings/numbers under namespaces Craig's recent commit under that newlib branch dealing with namespace support has prompted me to review top's handling of those fields. Currently, when such a field is zero, top displays a dash ('-'). This will mean the justification toggles ('j/J') will behave incorrectly. This patch simply allows the potential zero to display or be suppressed with the already existing '0' toggle. Signed-off-by: Jim Warner --- top/top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/top/top.c b/top/top.c index c55a1618..b726b453 100644 --- a/top/top.c +++ b/top/top.c @@ -5069,8 +5069,8 @@ static const char *task_show (const WIN_t *q, const int idx) { case EU_NS5: case EU_NS6: { long ino = rSv(i, ul_int); - if (ino > 0) cp = make_num(ino, W, Jn, i); - else cp = make_str("-", W, Js, i); + if (Rc.zero_suppress && 0 >= ino) cp = make_str("", W, Js, i); + else cp = make_num(ino, W, Jn, i); } break; /* ull_int, scale_tics */