about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-12-17 07:02:26 +0000
committerUlrich Drepper <drepper@redhat.com>1998-12-17 07:02:26 +0000
commit68185625b4f0021d83e69d90ca9255e5a1be0cf6 (patch)
tree92666e845981065438cc51b0a36877f04d82db2b
parent04166d6ee15cdcc3f1a5f384fdeb76ba892ecaf5 (diff)
downloadglibc-68185625b4f0021d83e69d90ca9255e5a1be0cf6.tar.gz
glibc-68185625b4f0021d83e69d90ca9255e5a1be0cf6.tar.xz
glibc-68185625b4f0021d83e69d90ca9255e5a1be0cf6.zip
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]
-rw-r--r--ChangeLog5
-rw-r--r--login/login.c8
-rw-r--r--manual/libc.texinfo6
3 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e9c13c351..b665f3534d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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]
+
 1998-12-16  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
 
 	* sysdeps/posix/tempname.c (__path_search): Add casts for format
diff --git a/login/login.c b/login/login.c
index a7875f2bb9..ca0ef57fff 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);
diff --git a/manual/libc.texinfo b/manual/libc.texinfo
index 0beec66fd6..a09d65fbc7 100644
--- a/manual/libc.texinfo
+++ b/manual/libc.texinfo
@@ -17,9 +17,9 @@
 @comment %**end of header (This is for running Texinfo on a region.)
 
 @c sold 0.06/1.09, print run out 21may96
-@set EDITION 0.07 DRAFT
-@set VERSION 2.00 Beta
-@set UPDATED 03 Apr 1998
+@set EDITION 0.08 DRAFT
+@set VERSION 2.1 Beta
+@set UPDATED 17 Dec 1998
 @set ISBN 1-882114-53-1
 
 @ifinfo