From: Jim Meyering Date: Sat, 18 Dec 1999 11:48:37 +0000 (+0000) Subject: (print_entry): Correct do_lookup test so that who X-Git-Tag: FILEUTILS-4_0l~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a47deedda7229dc4857cca949029d0c73f99bfa6;p=thirdparty%2Fcoreutils.git (print_entry): Correct do_lookup test so that who prints whatever host information it has, even without --lookup. --- 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;