merge leres code
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Thu, 16 Jun 1983 04:26:56 +0000 (20:26 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Thu, 16 Jun 1983 04:26:56 +0000 (20:26 -0800)
SCCS-vsn: usr.bin/mail/def.h 2.12
SCCS-vsn: usr.bin/mail/lex.c 2.13

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

index 3a855d4..28e1f63 100644 (file)
@@ -10,7 +10,7 @@
 #undef isdigit
 
 /*
 #undef isdigit
 
 /*
- * Sccs Id = "@(#)def.h        2.11 %G%";
+ * Sccs Id = "@(#)def.h        2.12 %G%";
  */
 
 /*
  */
 
 /*
@@ -256,6 +256,13 @@ struct ignore {
 #define        sigsys(s, a)    signal(s, a)
 #endif
 
 #define        sigsys(s, a)    signal(s, a)
 #endif
 
+/*
+ * Truncate a file to the last character written. This is
+ * useful just before closing an old file that was opened
+ * for read/write.
+ */
+#define trunc(stream)  ftruncate(fileno(stream), (long) ftell(stream))
+
 /*
  * Forward declarations of routine types to keep lint and cc happy.
  */
 /*
  * Forward declarations of routine types to keep lint and cc happy.
  */
index 3741d25..3081a4d 100644 (file)
@@ -8,7 +8,7 @@
  * Lexical processing of commands.
  */
 
  * Lexical processing of commands.
  */
 
-static char *SccsId = "@(#)lex.c       2.12 %G%";
+static char *SccsId = "@(#)lex.c       2.13 %G%";
 
 char   *prompt = "& ";
 
 
 char   *prompt = "& ";
 
@@ -121,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();
 
                /*