real usage message
[unix-history] / usr / src / usr.bin / mail / temp.c
index bef0669..ef26cc6 100644 (file)
@@ -1,4 +1,18 @@
-#
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of California at Berkeley. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
+ */
+
+#ifdef notdef
+static char sccsid[] = "@(#)temp.c     5.4 (Berkeley) %G%";
+#endif /* notdef */
 
 #include "rcv.h"
 
 
 #include "rcv.h"
 
@@ -8,8 +22,6 @@
  * Give names to all the temporary files that we will need.
  */
 
  * Give names to all the temporary files that we will need.
  */
 
-static char *SccsId = "@(#)temp.c      1.3 %G%";
-
 char   tempMail[14];
 char   tempQuit[14];
 char   tempEdit[14];
 char   tempMail[14];
 char   tempQuit[14];
 char   tempEdit[14];
@@ -19,10 +31,10 @@ char        tempMesg[14];
 
 tinit()
 {
 
 tinit()
 {
-       register char *cp, *cp2;
+       register char *cp;
        char uname[PATHSIZE];
        char uname[PATHSIZE];
-       register int err = 0;
        register int pid;
        register int pid;
+       uid_t getuid();
 
        pid = getpid();
        sprintf(tempMail, "/tmp/Rs%05d", pid);
 
        pid = getpid();
        sprintf(tempMail, "/tmp/Rs%05d", pid);
@@ -41,30 +53,23 @@ tinit()
                }
        }
        else {
                }
        }
        else {
-               uid = getuid() & UIDMASK;
+               uid = getuid();
                if (username(uid, uname) < 0) {
                if (username(uid, uname) < 0) {
-                       copy("ubluit", myname);
-                       err++;
+                       strcpy(myname, "ubluit");
                        if (rcvmode) {
                                printf("Who are you!?\n");
                                exit(1);
                        }
                        if (rcvmode) {
                                printf("Who are you!?\n");
                                exit(1);
                        }
-               }
-               else
-                       copy(uname, myname);
+               } else
+                       strcpy(myname, uname);
        }
        }
-       mailname = mailspace;
-       cp = value("HOME");
-       if (cp == NOSTR)
+       if ((cp = value("HOME")) == NOSTR)
                cp = ".";
                cp = ".";
-       copy(cp, homedir);
+       strcpy(homedir, cp);
        findmail();
        findmail();
-       cp = copy(homedir, mbox);
-       copy("/mbox", cp);
-       cp = copy(homedir, mailrc);
-       copy("/.mailrc", cp);
-       cp = copy(homedir, deadletter);
-       copy("/dead.letter", cp);
+       strcpy(copy(homedir, mbox), "/mbox");
+       strcpy(copy(homedir, mailrc), "/.mailrc");
+       strcpy(copy(homedir, deadletter), "/dead.letter");
        if (debug) {
                printf("uid = %d, user = %s, mailname = %s\n",
                    uid, myname, mailname);
        if (debug) {
                printf("uid = %d, user = %s, mailname = %s\n",
                    uid, myname, mailname);