delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/07/22/09:28:44

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <39798DC1.8F9249CD@phekda.freeserve.co.uk>
Date: Sat, 22 Jul 2000 13:04:17 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
CC: eljasiak AT neptun DOT gdansk DOT tpsa DOT pl
Subject: Patch to make getlogin() examine env. var. USERNAME
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019