Mail Archives: djgpp-workers/2000/07/22/09:28:44
This is a multi-part message in MIME format.
--------------7C488616D0F635E8C5DCA71A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello.
Please find attached a patch to make getlogin() examine the USERNAME
environment variable. It does this after USER, LOGNAME. A what's changed
entry is also included. Before/if the patch is committed to CVS, could
someone please check that USERNAME is not set on Windows '98, so that the
texinfo doc is correct. (I do not have access to Windows '98.) I've
checked '95, NT, 2000.
Thanks, bye, Rich
--------------7C488616D0F635E8C5DCA71A
Content-Type: text/plain; charset=us-ascii;
name="diffs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="diffs"
*** src/libc/posix/unistd/getlogin.c Tue Jan 25 19:37:27 2000
--- /home/rich/src/djgpp/src/libc/posix/unistd/getlogin.c Sat Jul 22 12:57:11 2000
***************
*** 1,3 ****
--- 1,4 ----
+ /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <unistd.h>
***************
*** 13,18 ****
--- 14,21 ----
p = getenv("USER");
if (!p)
p = getenv("LOGNAME");
+ if (!p)
+ p = getenv("USERNAME");
if (!p)
p = default_login;
return p;
*** src/libc/posix/unistd/getlogin.txh Sun Sep 27 16:22:24 1998
--- /home/rich/src/djgpp/src/libc/posix/unistd/getlogin.txh Sat Jul 22 12:55:11 2000
***************
*** 14,20 ****
@subheading Return Value
Returns the value of the @code{USER} environment variable, else the
! @code{LOGNAME} environment variable, else @code{"dosuser"}.
@subheading Portability
--- 14,24 ----
@subheading Return Value
Returns the value of the @code{USER} environment variable, else the
! @code{LOGNAME} environment variable, else the @code{USERNAME} environment
! variable, else @code{dosuser}.
!
! @code{USERNAME} is set automatically under Windows NT and 2000. None of these
! environment variables are set automatically under DOS, Windows '95 or '98.
@subheading Portability
*** src/docs/kb/wc204.txi Sun Jul 16 22:36:26 2000
--- /home/rich/src/djgpp/src/docs/kb/wc204.txi Sat Jul 22 12:42:54 2000
***************
*** 71,73 ****
--- 71,76 ----
@findex erand48 AT r{, increased speed}
The execution speed of @code{drand48} and @code{erand48} has been improved.
+ @findex getlogin
+ @code{getlogin} now examines the environment variable @code{USERNAME} to
+ determine the user's name, in addition to @code{USER}, @code{LOGNAME}.
--------------7C488616D0F635E8C5DCA71A--
- Raw text -