diff options
author | Miles Bader <miles@gnu.org> | 1996-07-07 14:39:55 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-07-07 14:39:55 +0000 |
commit | 1319f7565bd0a6260bf4b39c7262c4995a2f023c (patch) | |
tree | 00a0df24b07f58909629c4801958a8f865f3f973 /daemons | |
parent | 50417b38e1096270df0fba26af31df5b1cbacd8f (diff) |
(print_banner): Use basename instead of rolling our own.
Diffstat (limited to 'daemons')
-rw-r--r-- | daemons/getty.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/daemons/getty.c b/daemons/getty.c index cc7e9fc6..e6bd939b 100644 --- a/daemons/getty.c +++ b/daemons/getty.c @@ -44,19 +44,12 @@ print_banner (int fd, char *ttyname) char *s; struct utsname u; char *hostname = localhost (); - char *t; if (uname (&u)) u.sysname[0] = u.release[0] = '\0'; - t = rindex (ttyname, '/'); - if (t) - t++; - else - t = ttyname; - cc = asprintf (&s, "\r\n\n%s %s (%s) (%s)\r\n\n", - u.sysname, u.release, hostname ?: "?", t); + u.sysname, u.release, hostname ?: "?", basename (ttyname)); write (fd, s, cc); } |