document distributed with 4.1BSD
[unix-history] / usr / src / usr.bin / ex / ex_cmds.c
index 962449f..ba0fd47 100644 (file)
@@ -1,9 +1,18 @@
-/* Copyright (c) 1980 Regents of the University of California */
-static char *sccsid = "@(#)ex_cmds.c   5.3 %G%";
+/*
+ * 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 = "@(#)ex_cmds.c   7.10 (Berkeley) %G%";
+#endif not lint
+
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
+#include "ex_vis.h"
 
 bool   pflag, nflag;
 int    poffset;
 
 bool   pflag, nflag;
 int    poffset;
@@ -269,6 +278,11 @@ doecmd:
                        laste++;
                        sync();
                        rop(c);
                        laste++;
                        sync();
                        rop(c);
+#ifdef VMUNIX
+                       tlaste();
+#endif
+                       laste = 0;
+                       sync();
                        nochng();
                        continue;
 
                        nochng();
                        continue;
 
@@ -454,10 +468,6 @@ quit:
                                        vnfl();
                                else {
                                        tostop();
                                        vnfl();
                                else {
                                        tostop();
-                                       /* replaced by tostop
-                                       putpad(VE);
-                                       putpad(KE);
-                                       */
                                }
                                flush();
                                setty(normf);
                                }
                                flush();
                                setty(normf);
@@ -510,6 +520,10 @@ quit:
                                                rop3(c);
                                        if (dol != zero)
                                                change();
                                                rop3(c);
                                        if (dol != zero)
                                                change();
+#ifdef VMUNIX
+                                       tlaste();
+#endif
+                                       laste = 0;
                                        nochng();
                                        continue;
                                }
                                        nochng();
                                        continue;
                                }
@@ -562,8 +576,10 @@ quit:
 
 /* source */
                        case 'o':
 
 /* source */
                        case 'o':
+#ifdef notdef
                                if (inopen)
                                        goto notinvis;
                                if (inopen)
                                        goto notinvis;
+#endif
                                tail("source");
                                setnoaddr();
                                getone();
                                tail("source");
                                setnoaddr();
                                getone();
@@ -571,16 +587,19 @@ quit:
                                source(file, 0);
                                continue;
 #ifdef SIGTSTP
                                source(file, 0);
                                continue;
 #ifdef SIGTSTP
-/* stop */
+/* stop, suspend */
                        case 't':
                                tail("stop");
                        case 't':
                                tail("stop");
+                               goto suspend;
+                       case 'u':
+                               tail("suspend");
+suspend:
                                if (!ldisc)
                                        error("Old tty driver|Not using new tty driver/shell");
                                c = exclam();
                                eol();
                                if (!c)
                                        ckaw();
                                if (!ldisc)
                                        error("Old tty driver|Not using new tty driver/shell");
                                c = exclam();
                                eol();
                                if (!c)
                                        ckaw();
-                               eol();
                                onsusp();
                                continue;
 #endif
                                onsusp();
                                continue;
 #endif
@@ -653,7 +672,7 @@ quit:
 /* version */
                                tail("version");
                                setNAEOL();
 /* version */
                                tail("version");
                                setNAEOL();
-                               printf("@(#) Version 3.5, %G%."+5);
+                               printf("@(#) Version 3.7, %G%."+5);
                                noonl();
                                continue;
 
                                noonl();
                                continue;