When both LOGNAME and USER environment variables are set, favour LOGNAME.

This commit is contained in:
jtc 1993-07-28 17:49:22 +00:00
parent 2680a043c7
commit 5b1c27146a

View File

@ -73,6 +73,8 @@ username()
{
char *np;
if ((np = getenv("LOGNAME")) != NOSTR)
return np;
if ((np = getenv("USER")) != NOSTR)
return np;
return getname(getuid());