Fix default mailpath

This commit is contained in:
Andrey A. Chernov 1995-03-30 01:13:41 +00:00
parent 5c95f7a6dc
commit cddeed288c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7482

View File

@ -460,10 +460,15 @@ int getuserinfo(void)
else
(void) Strncpy(uinfo.homedir, pw->pw_dir);
cp = getenv("MAIL");
#ifndef __FreeBSD__
if (cp == NULL)
cp = getenv("mail");
if (cp == NULL)
(void) sprintf(str, "/usr/spool/mail/%s", uinfo.username);
#else
if (cp == NULL)
(void) sprintf(str, "/var/mail/%s", uinfo.username);
#endif
else
(void) Strncpy(str, cp);
cp = str;