From 87a83d449c1b93f77d6367fd468567a8ed911425 Mon Sep 17 00:00:00 2001 From: lukem Date: Mon, 20 Oct 1997 03:20:27 +0000 Subject: [PATCH] fix .Nm usage, deprecate register, use ANSI string.h stuff --- usr.bin/who/Makefile | 3 +-- usr.bin/who/who.1 | 12 ++++++------ usr.bin/who/who.c | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/usr.bin/who/Makefile b/usr.bin/who/Makefile index 1b074abb30b4..0bd2789a20a8 100644 --- a/usr.bin/who/Makefile +++ b/usr.bin/who/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.4 1997/07/23 20:09:25 kleink Exp $ +# $NetBSD: Makefile,v 1.5 1997/10/20 03:20:27 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= who -WARNS= 1 .include diff --git a/usr.bin/who/who.1 b/usr.bin/who/who.1 index f97ca3a3cbe0..22ccda595cc3 100644 --- a/usr.bin/who/who.1 +++ b/usr.bin/who/who.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: who.1,v 1.8 1997/09/09 07:31:15 jtc Exp $ +.\" $NetBSD: who.1,v 1.9 1997/10/20 03:20:28 lukem Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -40,14 +40,14 @@ .Nm who .Nd display who is logged in .Sh SYNOPSIS -.Nm who +.Nm .Op Fl mTuH .Op Ar file -.Nm who +.Nm "" .Ar am i .Sh DESCRIPTION The -.Nm who +.Nm utility displays a list of all users currently logged on, showing for each user the login name, tty name, the date and time of login, and hostname if not local. @@ -59,7 +59,7 @@ Available options: Only print information about the current terminal. This is the .Tn POSIX way of saying -.Nm who +.Nm .Ar am i . .It Fl T Print a character after the user name indicating the state of the @@ -79,7 +79,7 @@ Write column headings above the regular output. Returns the invoker's real user name. .It Ar file By default, -.Nm who +.Nm gathers information from the file .Pa /var/run/utmp . An alternative diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c index bf137f895d2a..f045888f13a6 100644 --- a/usr.bin/who/who.c +++ b/usr.bin/who/who.c @@ -1,4 +1,4 @@ -/* $NetBSD: who.c,v 1.5 1997/07/23 20:08:03 kleink Exp $ */ +/* $NetBSD: who.c,v 1.6 1997/10/20 03:20:29 lukem Exp $ */ /* * Copyright (c) 1989, 1993 @@ -47,7 +47,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: who.c,v 1.5 1997/07/23 20:08:03 kleink Exp $"); +__RCSID("$NetBSD: who.c,v 1.6 1997/10/20 03:20:29 lukem Exp $"); #endif /* not lint */ #include @@ -156,13 +156,13 @@ who_am_i(ufp) { struct utmp usr; struct passwd *pw; - register char *p; + char *p; char *t; /* search through the utmp and find an entry for this tty */ if ((p = ttyname(0)) != NULL) { /* strip any directory component */ - if ((t = rindex(p, '/')) != NULL) + if ((t = strrchr(p, '/')) != NULL) p = t + 1; while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) if (usr.ut_name && !strcmp(usr.ut_line, p)) {