need fmt also
[unix-history] / usr / src / usr.bin / mail / lex.c
index aaf427b..3081a4d 100644 (file)
@@ -8,7 +8,7 @@
  * Lexical processing of commands.
  */
 
  * Lexical processing of commands.
  */
 
-static char *SccsId = "@(#)lex.c       2.9 %G%";
+static char *SccsId = "@(#)lex.c       2.13 %G%";
 
 char   *prompt = "& ";
 
 
 char   *prompt = "& ";
 
@@ -28,13 +28,8 @@ setfile(name, isedit)
        static char efile[128];
        extern char tempMesg[];
 
        static char efile[128];
        extern char tempMesg[];
 
-       if ((ibuf = fopen(name, "r")) == NULL) {
-               if (isedit)
-                       perror(name);
-               else
-                       printf("No mail for %s\n", myname);
+       if ((ibuf = fopen(name, "r")) == NULL)
                return(-1);
                return(-1);
-       }
 
        /*
         * Looks like all will be well.  We must now relinquish our
 
        /*
         * Looks like all will be well.  We must now relinquish our
@@ -126,12 +121,13 @@ commands()
                eofloop = 0;
 top:
                if (shudprompt) {
                eofloop = 0;
 top:
                if (shudprompt) {
+                       printf(prompt);
+                       flush();
 # ifdef VMUNIX
                        sigset(SIGCONT, contin);
 # endif VMUNIX
 # ifdef VMUNIX
                        sigset(SIGCONT, contin);
 # endif VMUNIX
-                       printf(prompt);
-               }
-               flush();
+               } else
+                       flush();
                sreset();
 
                /*
                sreset();
 
                /*
@@ -527,9 +523,7 @@ stop(s)
        }
        clrbuf(stdout);
        printf("Interrupt\n");
        }
        clrbuf(stdout);
        printf("Interrupt\n");
-# ifdef VMUNIX
-       sigrelse(s);
-# else
+# ifndef VMUNIX
        signal(s, stop);
 # endif
        reset(0);
        signal(s, stop);
 # endif
        reset(0);
@@ -547,11 +541,11 @@ announce(pr)
        int vec[2], mdot;
        extern char *version;
 
        int vec[2], mdot;
        extern char *version;
 
+       if (pr && value("quiet") == NOSTR)
+               printf(greeting, version);
        mdot = newfileinfo();
        vec[0] = mdot;
        vec[1] = 0;
        mdot = newfileinfo();
        vec[0] = mdot;
        vec[1] = 0;
-       if (pr && value("quiet") == NOSTR)
-               printf(greeting, version);
        dot = &message[mdot - 1];
        if (msgCount > 0 && !noheader) {
                inithdr++;
        dot = &message[mdot - 1];
        if (msgCount > 0 && !noheader) {
                inithdr++;