< and > are non-standard on sets.
[unix-history] / usr / src / usr.bin / ex / ex_cmds.c
index 877be9b..8c8f9d5 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char *sccsid = "@(#)ex_cmds.c   5.1 %G%";
+static char *sccsid = "@(#)ex_cmds.c   6.3 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -454,10 +454,6 @@ quit:
                                        vnfl();
                                else {
                                        tostop();
                                        vnfl();
                                else {
                                        tostop();
-                                       /* replaced by tostop
-                                       putpad(VE);
-                                       putpad(KE);
-                                       */
                                }
                                flush();
                                setty(normf);
                                }
                                flush();
                                setty(normf);
@@ -474,9 +470,12 @@ quit:
                                case 'w':
                                        tail2of("rewind");
                                        setnoaddr();
                                case 'w':
                                        tail2of("rewind");
                                        setnoaddr();
+                                       if (!exclam()) {
+                                               ckaw();
+                                               if (chng && dol > zero)
+                                                       error("No write@since last chage (:rewind! overrides)");
+                                       }
                                        eol();
                                        eol();
-                                       ckaw();
-                                       ignore(quickly());
                                        erewind();
                                        next();
                                        c = 'e';
                                        erewind();
                                        next();
                                        c = 'e';
@@ -559,25 +558,30 @@ quit:
 
 /* source */
                        case 'o':
 
 /* source */
                        case 'o':
+#ifdef notdef
                                if (inopen)
                                        goto notinvis;
                                if (inopen)
                                        goto notinvis;
+#endif
                                tail("source");
                                setnoaddr();
                                getone();
                                eol();
                                source(file, 0);
                                continue;
                                tail("source");
                                setnoaddr();
                                getone();
                                eol();
                                source(file, 0);
                                continue;
-#ifdef TIOCLGET
-/* stop */
+#ifdef SIGTSTP
+/* 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
@@ -650,7 +654,7 @@ quit:
 /* version */
                                tail("version");
                                setNAEOL();
 /* version */
                                tail("version");
                                setNAEOL();
-                               printf("@(#) Version 3.5, %G%"+5);
+                               printf("@(#) Version 3.6, %G%."+5);
                                noonl();
                                continue;
 
                                noonl();
                                continue;