added "more" command
[unix-history] / usr / src / usr.bin / mail / v7.local.c
index 84b1c6c..9cc6647 100644 (file)
@@ -1,4 +1,12 @@
-#
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)v7.local.c 5.1 (Berkeley) %G%";
+#endif not lint
 
 /*
  * Mail -- a mail program
 
 /*
  * Mail -- a mail program
@@ -10,8 +18,6 @@
 
 #include "rcv.h"
 
 
 #include "rcv.h"
 
-static char *SccsId = "@(#)v7.local.c  1.2 %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.
 /*
  * 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.
@@ -36,7 +42,12 @@ findmail()
 demail()
 {
 
 demail()
 {
 
-       remove(mailname);
+       if (value("keep") != NOSTR)
+               close(creat(mailname, 0666));
+       else {
+               if (remove(mailname) < 0)
+                       close(creat(mailname, 0666));
+       }
 }
 
 /*
 }
 
 /*