From 5b1c27146a2204dc8595f0c6cdd5b482d68f00cc Mon Sep 17 00:00:00 2001 From: jtc Date: Wed, 28 Jul 1993 17:49:22 +0000 Subject: [PATCH] When both LOGNAME and USER environment variables are set, favour LOGNAME. --- usr.bin/mail/v7.local.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/mail/v7.local.c b/usr.bin/mail/v7.local.c index fb088ee348ff..3e78fce709bb 100644 --- a/usr.bin/mail/v7.local.c +++ b/usr.bin/mail/v7.local.c @@ -73,6 +73,8 @@ username() { char *np; + if ((np = getenv("LOGNAME")) != NOSTR) + return np; if ((np = getenv("USER")) != NOSTR) return np; return getname(getuid());