When both LOGNAME and USER environment variables are set, favour LOGNAME.
This commit is contained in:
parent
2680a043c7
commit
5b1c27146a
@ -73,6 +73,8 @@ username()
|
||||
{
|
||||
char *np;
|
||||
|
||||
if ((np = getenv("LOGNAME")) != NOSTR)
|
||||
return np;
|
||||
if ((np = getenv("USER")) != NOSTR)
|
||||
return np;
|
||||
return getname(getuid());
|
||||
|
Loading…
Reference in New Issue
Block a user