summaryrefslogtreecommitdiff
path: root/usr.bin/finger/net.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-04-23 19:17:30 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-04-23 19:17:30 +0000
commit7e378947f64dc0d600c7527445239da1d75dcbdb (patch)
tree84a0d55311694278e310bc55e37ae57522d8ebc2 /usr.bin/finger/net.c
parent661f9153af046f17b18404425b365e2e1ba33574 (diff)
Treat "finger@" like "finger@localhost" to act more like
traditional finger. Noticed by Theo.
Diffstat (limited to 'usr.bin/finger/net.c')
-rw-r--r--usr.bin/finger/net.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c
index bba31a796cc..8d206a8a0d7 100644
--- a/usr.bin/finger/net.c
+++ b/usr.bin/finger/net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: net.c,v 1.3 1997/01/17 07:12:33 millert Exp $ */
+/* $OpenBSD: net.c,v 1.4 1997/04/23 19:17:29 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -38,7 +38,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)net.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: net.c,v 1.3 1997/01/17 07:12:33 millert Exp $";
+static char rcsid[] = "$OpenBSD: net.c,v 1.4 1997/04/23 19:17:29 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -65,6 +65,8 @@ netfinger(name)
if (!(host = strrchr(name, '@')))
return;
*host++ = NULL;
+ if (*host == NULL)
+ host = "localhost";
if (inet_aton(host, &sin.sin_addr) == 0) {
hp = gethostbyname(host);
if (hp == 0) {