summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-12-18 11:48:37 +0000
committerJim Meyering <jim@meyering.net>1999-12-18 11:48:37 +0000
commita47deedda7229dc4857cca949029d0c73f99bfa6 (patch)
treed08eacebabb841063ffcee1777dfd9139e3c8f9e /src
parenta9c3d9197f71fc387320b4a6f60e7c7e6ffe265e (diff)
downloadcoreutils-a47deedda7229dc4857cca949029d0c73f99bfa6.tar.xz
(print_entry): Correct do_lookup test so that who
prints whatever host information it has, even without --lookup.
Diffstat (limited to 'src')
-rw-r--r--src/who.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/who.c b/src/who.c
index b2a5995d9..6ab23d284 100644
--- a/src/who.c
+++ b/src/who.c
@@ -175,7 +175,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
printf (" . ");
}
#if HAVE_UT_HOST
- if (utmp_ent->ut_host[0] && do_lookup)
+ if (utmp_ent->ut_host[0])
{
char ut_host[sizeof (utmp_ent->ut_host) + 1];
char *host = 0, *display = 0;
@@ -189,9 +189,12 @@ print_entry (const STRUCT_UTMP *utmp_ent)
if (display)
*display++ = '\0';
- if (*ut_host)
- /* See if we can canonicalize it. */
- host = canon_host (ut_host);
+ if (*ut_host && do_lookup)
+ {
+ /* See if we can canonicalize it. */
+ host = canon_host (ut_host);
+ }
+
if (! host)
host = ut_host;