From ken@wc206.residence.gatech.edu  Sat Jul  1 17:24:38 1995
Received: from wc206.residence.gatech.edu (root@wc206.residence.gatech.edu [199.77.224.206])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id RAA08692
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 1 Jul 1995 17:24:38 -0700
Received: (from ken@localhost) by wc206.residence.gatech.edu (8.6.11/8.6.9) id UAA05021; Sat, 1 Jul 1995 20:25:23 -0400
Message-Id: <199507020025.UAA05021@wc206.residence.gatech.edu>
Date: Sat, 1 Jul 1995 20:25:23 -0400
From: ken@wc206.residence.gatech.edu
Reply-To: ken@wc206.residence.gatech.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: w -h doesn't suppress all headers
X-Send-Pr-Version: 3.2

>Number:         578
>Category:       bin
>Synopsis:       w -h doesn't suppress "USER    TTY"...etc.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul  1 17:30:00 1995
>Closed-Date:    Sun Jul 16 21:38:52 PDT 1995
>Last-Modified:
>Originator:     Kenneth D. Merry
>Release:        FreeBSD 2.0-BUILT-19950527 i386
>Organization:
Georgia Institute of Technology
>Environment:

	486-100, FreeBSD 2.0.5 Alpha with a 2.0.5R Kernel

>Description:

	/usr/bin/w -h only suppresses the 'uptime' type header, not the
"USER    TTY FROM              LOGIN@  IDLE WHAT" header.  Under 1.1, the
default behavior was to suppress all headers.  It changed as of 2.0 to the
current behavior.  Looking at the 4.4 BSD-Lite source tree, it seems that
that's where the behavior change came in.  (i.e. it isn't unique to
FreeBSD)


>How-To-Repeat:

	/usr/bin/w -h on any 2.0 or later FreeBSD machine.

>Fix:
		
	This is a simple, one-line fix.  It moves a } down a couple of
lines.  Hopefully I did the diff right....


	
*** w.old	Tue May 30 02:36:12 1995
--- w.c	Sat Jul  1 20:04:25 1995
***************
*** 217,227 ****
  		pr_header(&now, nusers);
  		if (wcmd == 0)
  			exit (0);
- 	}
  
  #define HEADER	"USER    TTY FROM              LOGIN@  IDLE WHAT\n"
  #define WUSED	(sizeof (HEADER) - sizeof ("WHAT\n"))
  	(void)printf(HEADER);
  
  	if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
  		err(1, "%s", kvm_geterr(kd));
--- 217,227 ----
  		pr_header(&now, nusers);
  		if (wcmd == 0)
  			exit (0);
  
  #define HEADER	"USER    TTY FROM              LOGIN@  IDLE WHAT\n"
  #define WUSED	(sizeof (HEADER) - sizeof ("WHAT\n"))
  	(void)printf(HEADER);
+ 	}
  
  	if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
  		err(1, "%s", kvm_geterr(kd));

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Sun Jul 16 21:38:52 PDT 1995 
State-Changed-Why:  
Suggested fix applied in rev 1.6 of w.c 
>Unformatted:



