From 00a213959cbe3a762de9e6466287706e69c1bb05 Mon Sep 17 00:00:00 2001 From: "Kurt A. Schoens" Date: Wed, 8 Oct 1980 17:52:17 -0800 Subject: [PATCH] date and time created 80/10/08 09:52:17 by kas SCCS-vsn: usr.bin/mail/v7.local.c 1.1 --- usr/src/usr.bin/mail/v7.local.c | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 usr/src/usr.bin/mail/v7.local.c diff --git a/usr/src/usr.bin/mail/v7.local.c b/usr/src/usr.bin/mail/v7.local.c new file mode 100644 index 0000000000..efbcc1b940 --- /dev/null +++ b/usr/src/usr.bin/mail/v7.local.c @@ -0,0 +1,56 @@ +# + +/* + * Mail -- a mail program + * + * Version 7 + * + * Local routines that are installation dependent. + */ + +#include "rcv.h" + +static char *SccsId = "@(#)v7.local.c 1.1 %G%"; + +/* + * Locate the user's mailbox file (ie, the place where new, unread + * mail is queued). In Version 7, it is in /usr/spool/mail/name. + */ + +findmail() +{ + register char *cp; + + cp = copy("/usr/spool/mail/", mailname); + copy(myname, cp); + if (isdir(mailname)) { + stradd(mailname, '/'); + strcat(mailname, myname); + } +} + +/* + * Get rid of the queued mail. + */ + +demail() +{ + + remove(mailname); +} + +/* + * Discover user login name. + */ + +username(uid, namebuf) + char namebuf[]; +{ + register char *np; + + if (uid == getuid() && (np = getenv("USER")) != NOSTR) { + strncpy(namebuf, np, 9); + return(0); + } + return(getname(uid, namebuf)); +} -- 2.20.1