home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1989, 1990, John F. Haugh II
- * All rights reserved.
- *
- * Use, duplication, and disclosure prohibited without
- * the express written permission of the author.
- */
-
- #include <sys/types.h>
- #include <sys/stat.h>
- #ifndef BSD
- #include <string.h>
- #include <memory.h>
- #else
- #include <strings.h>
- #define strchr index
- #define strrchr rindex
- #endif
- #include "config.h"
-
- #ifndef lint
- static char _sccsid[] = "@(#)mail.c 2.2 19:23:56 7/29/90";
- #endif
-
- extern char mail[];
-
- #ifdef HUSHLOGIN
- extern int hushed;
- #endif
-
- #ifdef MAILCHECK
- void mailcheck ()
- {
- struct stat statbuf;
- char *mailbox;
-
- #ifdef HUSHLOGIN
- if (hushed)
- return;
- #endif
- if (mailbox = strchr (mail, '='))
- mailbox++;
- else
- return;
-
- if (stat (mailbox, &statbuf) == -1 || statbuf.st_size == 0)
- puts ("No mail.");
- else if (statbuf.st_atime > statbuf.st_mtime)
- puts ("You have mail.");
- else
- puts ("You have new mail.");
- }
- #endif
-