From a47deedda7229dc4857cca949029d0c73f99bfa6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 18 Dec 1999 11:48:37 +0000 Subject: [PATCH] (print_entry): Correct do_lookup test so that who prints whatever host information it has, even without --lookup. --- src/who.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/who.c b/src/who.c index b2a5995d94..6ab23d284b 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; -- 2.47.3