diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-12-17 07:02:26 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-12-17 07:02:26 +0000 |
commit | 68185625b4f0021d83e69d90ca9255e5a1be0cf6 (patch) | |
tree | 92666e845981065438cc51b0a36877f04d82db2b /login/login.c | |
parent | 04166d6ee15cdcc3f1a5f384fdeb76ba892ecaf5 (diff) | |
download | glibc-68185625b4f0021d83e69d90ca9255e5a1be0cf6.zip glibc-68185625b4f0021d83e69d90ca9255e5a1be0cf6.tar.gz glibc-68185625b4f0021d83e69d90ca9255e5a1be0cf6.tar.bz2 |
update
1998-12-17 Ulrich Drepper <drepper@cygnus.com>
* login/login.c: Determine pts/3 and terminal name if path is
/dev/pts/3. This is consistent with getlogin. [PR libc/906]
Diffstat (limited to 'login/login.c')
-rw-r--r-- | login/login.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/login/login.c b/login/login.c index a7875f2..ca0ef57 100644 --- a/login/login.c +++ b/login/login.c @@ -107,8 +107,12 @@ login (const struct utmp *ut) if (found_tty >= 0) { - /* We only want to insert the name of the tty without path. */ - ttyp = basename (tty); + /* We only want to insert the name of the tty without path. + But take care of name like /dev/pts/3. */ + if (strncmp (tty, "/dev/", 5) == 0) + ttyp = tty + 5; /* Skip the "/dev/". */ + else + ttyp = basename (tty); /* Position to record for this tty. */ strncpy (copy.ut_line, ttyp, UT_LINESIZE); |