From bf0839bdc972c2a6a799efedd2f3f5b5e16338cb Mon Sep 17 00:00:00 2001 From: tjr Date: Thu, 31 Oct 2002 13:41:37 +0000 Subject: Do not print a header line if it would be empty; required by 1003.1-2001. --- bin/ps/print.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bin/ps/print.c') diff --git a/bin/ps/print.c b/bin/ps/print.c index 31a857b..86e9b45 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -72,7 +72,16 @@ printheader(void) { VAR *v; struct varent *vent; + int allempty; + allempty = 1; + for (vent = vhead; vent; vent = vent->next) + if (*vent->var->header != '\0') { + allempty = 0; + break; + } + if (allempty) + return; for (vent = vhead; vent; vent = vent->next) { v = vent->var; if (v->flag & LJUST) { -- cgit v1.1