diff options
author | Jim Meyering <jim@meyering.net> | 1999-12-18 11:48:37 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-12-18 11:48:37 +0000 |
commit | a47deedda7229dc4857cca949029d0c73f99bfa6 (patch) | |
tree | d08eacebabb841063ffcee1777dfd9139e3c8f9e /src | |
parent | a9c3d9197f71fc387320b4a6f60e7c7e6ffe265e (diff) | |
download | coreutils-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.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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; |