diff options
author | tjr <tjr@FreeBSD.org> | 2002-10-31 13:41:37 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-10-31 13:41:37 +0000 |
commit | bf0839bdc972c2a6a799efedd2f3f5b5e16338cb (patch) | |
tree | 783710f26ef2d58924a7969eb072fddba55bfb2c /bin/ps | |
parent | 0845c70b3de0f09be4f34c33b1b092b7499080e6 (diff) | |
download | FreeBSD-src-bf0839bdc972c2a6a799efedd2f3f5b5e16338cb.zip FreeBSD-src-bf0839bdc972c2a6a799efedd2f3f5b5e16338cb.tar.gz |
Do not print a header line if it would be empty; required by 1003.1-2001.
Diffstat (limited to 'bin/ps')
-rw-r--r-- | bin/ps/print.c | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |