Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/w skip blank entries.



details:   https://anonhg.NetBSD.org/src/rev/25f0558f018a
branches:  trunk
changeset: 534509:25f0558f018a
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jul 28 20:47:57 2002 +0000

description:
skip blank entries.

diffstat:

 usr.bin/w/w.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r c73615e6c398 -r 25f0558f018a usr.bin/w/w.c
--- a/usr.bin/w/w.c     Sun Jul 28 20:46:43 2002 +0000
+++ b/usr.bin/w/w.c     Sun Jul 28 20:47:57 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: w.c,v 1.48 2002/07/27 23:58:40 christos Exp $  */
+/*     $NetBSD: w.c,v 1.49 2002/07/28 20:47:57 christos Exp $  */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)w.c        8.6 (Berkeley) 6/30/94";
 #else
-__RCSID("$NetBSD: w.c,v 1.48 2002/07/27 23:58:40 christos Exp $");
+__RCSID("$NetBSD: w.c,v 1.49 2002/07/28 20:47:57 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -235,6 +235,8 @@
 
 #ifdef SUPPORT_UTMP
        while ((ut = getutent()) != NULL) {
+               if (ut->ut_name[0] == '\0')
+                       continue;
                ++nusers;
                if (wcmd == 0 || (sel_user &&
                    strncmp(ut->ut_name, sel_user, sizeof(ut->ut_name) != 0)))



Home | Main Index | Thread Index | Old Index