Added ignoreeof flag which requires explicit quit instead of
authorKurt A. Schoens <kas@ucbvax.Berkeley.EDU>
Thu, 9 Oct 1980 10:56:15 +0000 (02:56 -0800)
committerKurt A. Schoens <kas@ucbvax.Berkeley.EDU>
Thu, 9 Oct 1980 10:56:15 +0000 (02:56 -0800)
End of File from terminal to leave Mail.

SCCS-vsn: usr.bin/mail/lex.c 1.2

usr/src/usr.bin/mail/lex.c

index 73a25df..1328950 100644 (file)
@@ -8,7 +8,7 @@
  * Lexical processing of commands.
  */
 
  * Lexical processing of commands.
  */
 
-static char *SccsId = "@(#)lex.c       1.1 %G%";
+static char *SccsId = "@(#)lex.c       1.2 %G%";
 
 /*
  * Interpret user commands one by one.  If standard input is not a tty,
 
 /*
  * Interpret user commands one by one.  If standard input is not a tty,
@@ -60,6 +60,7 @@ commands()
 
                if (!rcvmode && !sourcing)
                        return;
 
                if (!rcvmode && !sourcing)
                        return;
+top:
                if (prompt && !sourcing)
                        printf("_\r");
                flush();
                if (prompt && !sourcing)
                        printf("_\r");
                flush();
@@ -79,6 +80,10 @@ commands()
                                        unstack();
                                        goto more;
                                }
                                        unstack();
                                        goto more;
                                }
+                               if (value("ignoreeof") != NOSTR && prompt) {
+                                       printf("Use \"quit\" to quit.\n");
+                                       goto top;
+                               }
                                if (!edit) {
                                        signal(SIGINT, SIG_IGN);
                                        return;
                                if (!edit) {
                                        signal(SIGINT, SIG_IGN);
                                        return;