delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/19/00:53:45

Date: Wed, 19 Jul 2000 07:52:18 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Piotr Eljasiak <eljasiak AT NO-SPAM DOT zt DOT gdansk DOT tpsa DOT pl>
cc: djgpp AT delorie DOT com
Subject: Re: Odp: User login name ?
In-Reply-To: <oK4d5.17772$pD2.355373@news.tpnet.pl>
Message-ID: <Pine.SUN.3.91.1000719075119.12022D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 18 Jul 2000, Piotr Eljasiak wrote:

> char *
> getlogin(void)
> {
>   char *p;
> 
>   p = getenv("USER");
>   if (!p)
>     p = getenv("LOGNAME");
>   if (!p)
>     p = getenv("USERNAME");
>   if (!p)
>     p = default_login;
>   return p;
> }

DJGPP's getlogin() already does two of these three; if you want the 
third, you could setenv("USERNAME", getenv("USER")) or something.

- Raw text -


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