diff options
| author | David Malone <dwmalone@FreeBSD.org> | 2002-07-28 16:17:38 +0000 |
|---|---|---|
| committer | David Malone <dwmalone@FreeBSD.org> | 2002-07-28 16:17:38 +0000 |
| commit | 81b4504baa72c0bb4e5d960934059abd566a60a5 (patch) | |
| tree | ad4fcbe65f1a6ec3455ee89bf13e9cea472394cd /usr.bin/login | |
| parent | 91fbb9c1dbbf6c06eea63f23ed770e6e3d116ef1 (diff) | |
Notes
Diffstat (limited to 'usr.bin/login')
| -rw-r--r-- | usr.bin/login/login.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 575963140f3fe..03f279e9cf4d9 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -555,17 +555,19 @@ main(int argc, char *argv[]) motd(_PATH_MOTDFILE); if (login_getcapbool(lc, "nocheckmail", 0) == 0) { + char *cx; + /* $MAIL may have been set by class. */ - cw = getenv("MAIL"); - if (cw == NULL) { - asprintf((char **)&cw, "%s/%s", + cx = getenv("MAIL"); + if (cx == NULL) { + asprintf(&cx, "%s/%s", _PATH_MAILDIR, pwd->pw_name); } - if (cw && stat(cw, &st) == 0 && st.st_size != 0) + if (cx && stat(cx, &st) == 0 && st.st_size != 0) (void)printf("You have %smail.\n", (st.st_mtime > st.st_atime) ? "new " : ""); if (getenv("MAIL") == NULL) - free((char *)cw); + free(cx); } } |
