|
|
1.1 ! root 1: #ident "@(#)usg.local.c 1.4 'attmail mail(1) command'" ! 2: #ident "@(#)mailx:usg.local.c 1.2.1.1" ! 3: /* Copyright (c) 1984 AT&T */ ! 4: /* All Rights Reserved */ ! 5: ! 6: /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */ ! 7: /* The copyright notice above does not evidence any */ ! 8: /* actual or intended publication of such source code. */ ! 9: ! 10: #ident "@(#)mailx:usg.local.c 1.2" ! 11: ! 12: /* ! 13: * mailx -- a modified version of a University of California at Berkeley ! 14: * mail program ! 15: * ! 16: * Local routines that are installation dependent. ! 17: */ ! 18: ! 19: #include "rcv.h" ! 20: ! 21: /* ! 22: * Locate the user's mailbox file (ie, the place where new, unread ! 23: * mail is queued). In SVr4 UNIX, it is in /var/mail/name. ! 24: * In preSVr4 UNIX, it is in either /usr/mail/name or /usr/spool/mail/name. ! 25: */ ! 26: void ! 27: findmail() ! 28: { ! 29: register char *cp; ! 30: ! 31: cp = copy(maildir, mailname); ! 32: copy(myname, cp); ! 33: if (isdir(mailname)) { ! 34: strcat(mailname, "/"); ! 35: strcat(mailname, myname); ! 36: } ! 37: } ! 38: ! 39: /* ! 40: * Discover user login name. ! 41: */ ! 42: ! 43: username(uid, namebuf) ! 44: uid_t uid; ! 45: char namebuf[]; ! 46: { ! 47: register char *np; ! 48: ! 49: if (uid == myruid && (np = getenv("LOGNAME")) != NOSTR) { ! 50: strncpy(namebuf, np, PATHSIZE); ! 51: return(0); ! 52: } ! 53: return(getname(uid, namebuf)); ! 54: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.