aboutsummaryrefslogtreecommitdiff
path: root/bin/ps/print.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-10-31 13:41:37 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-10-31 13:41:37 +0000
commit01e5f1664189b0a91f4a2becd1aafae3d8276111 (patch)
tree783710f26ef2d58924a7969eb072fddba55bfb2c /bin/ps/print.c
parent1acb5329c86305bcc28e19af29e056cb16f6d10a (diff)
downloadsrc-01e5f1664189b0a91f4a2becd1aafae3d8276111.tar.gz
src-01e5f1664189b0a91f4a2becd1aafae3d8276111.zip
Do not print a header line if it would be empty; required by 1003.1-2001.
Notes
Notes: svn path=/head/; revision=106251
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r--bin/ps/print.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 31a857bd81a9..86e9b45922c9 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) {