added sccs, Bill put in more buffers
authorMark Horton <mark@ucbvax.Berkeley.EDU>
Sat, 2 Aug 1980 08:59:04 +0000 (00:59 -0800)
committerMark Horton <mark@ucbvax.Berkeley.EDU>
Sat, 2 Aug 1980 08:59:04 +0000 (00:59 -0800)
SCCS-vsn: usr.bin/ex/ex.c 4.2
SCCS-vsn: usr.bin/ex/ex.h 4.2
SCCS-vsn: usr.bin/ex/ex_addr.c 4.2
SCCS-vsn: usr.bin/ex/ex_argv.h 4.2

usr/src/usr.bin/ex/ex.c
usr/src/usr.bin/ex/ex.h
usr/src/usr.bin/ex/ex_addr.c
usr/src/usr.bin/ex/ex_argv.h

index b10ceb8..4c46891 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex.c        4.2 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -95,6 +96,9 @@ main(ac, av)
        normf = tty;
 #endif
        ppid = getpid();
        normf = tty;
 #endif
        ppid = getpid();
+#ifdef HORSE
+       horse(ac, av);
+#endif
        /*
         * Defend against d's, v's, w's, and a's in directories of
         * path leading to our true name.
        /*
         * Defend against d's, v's, w's, and a's in directories of
         * path leading to our true name.
@@ -471,6 +475,9 @@ setrupt()
 preserve()
 {
 
 preserve()
 {
 
+#ifdef VMUNIX
+       tflush();
+#endif
        synctmp();
        pid = fork();
        if (pid < 0)
        synctmp();
        pid = fork();
        if (pid < 0)
index c9c0c76..a295ee3 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+/* sccs id:    @(#)ex.h        4.2 %G%  */
 #ifdef V6
 #include <retrofit.h>
 #endif
 #ifdef V6
 #include <retrofit.h>
 #endif
index afe1b7c..11a5fb2 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_addr.c   4.2 %G%";
 #include "ex.h"
 #include "ex_re.h"
 
 #include "ex.h"
 #include "ex_re.h"
 
@@ -197,108 +198,3 @@ address(inline)
                                                        loc2++;
                                                if (!execute(1))
                                                        goto nope;
                                                        loc2++;
                                                if (!execute(1))
                                                        goto nope;
-                                       }
-                                       break;
-                               } else if (loc1 < inline) {
-                                       char *last;
-doques:
-
-                                       do {
-                                               last = loc1;
-                                               if (loc1 == loc2)
-                                                       loc2++;
-                                               if (!execute(1))
-                                                       break;
-                                       } while (loc1 < inline);
-                                       loc1 = last;
-                                       break;
-                               }
-                       }
-nope:
-                       for (;;) {
-                               if (c == '/') {
-                                       addr++;
-                                       if (addr > dol) {
-                                               if (value(WRAPSCAN) == 0)
-error("No match to BOTTOM|Address search hit BOTTOM without matching pattern");
-                                               addr = zero;
-                                       }
-                               } else {
-                                       addr--;
-                                       if (addr < zero) {
-                                               if (value(WRAPSCAN) == 0)
-error("No match to TOP|Address search hit TOP without matching pattern");
-                                               addr = dol;
-                                       }
-                               }
-                               if (execute(0, addr)) {
-                                       if (inline && c == '?') {
-                                               inline = &linebuf[LBSIZE];
-                                               goto doques;
-                                       }
-                                       break;
-                               }
-                               if (addr == dot)
-                                       error("Fail|Pattern not found");
-                       }
-                       continue;
-
-               case '$':
-                       addr = dol;
-                       continue;
-
-               case '.':
-                       addr = dot;
-                       continue;
-
-               case '\'':
-                       c = markreg(getchar());
-                       if (c == 0)
-                               error("Marks are ' and a-z");
-                       addr = getmark(c);
-                       if (addr == 0)
-                               error("Undefined mark@referenced");
-                       break;
-
-               default:
-                       ungetchar(c);
-                       if (offset) {
-                               if (addr == 0)
-                                       addr = dot;
-                               addr += offset;
-                               loc1 = 0;
-                       }
-                       if (addr == 0) {
-                               bigmove = 0;
-                               return (0);
-                       }
-                       if (addr != zero)
-                               notempty();
-                       addr += lastsign;
-                       if (addr < zero)
-                               error("Negative address@- first buffer line is 1");
-                       if (addr > dol)
-                               error("Not that many lines@in buffer");
-                       return (addr);
-               }
-       }
-}
-
-/*
- * Abbreviations to make code smaller
- * Left over from squashing ex version 1.1 into
- * 11/34's and 11/40's.
- */
-setCNL()
-{
-
-       setcount();
-       newline();
-}
-
-setNAEOL()
-{
-
-       setnoaddr();
-       eol();
-}
index 666045b..07c7e20 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+/* sccs id:    @(#)ex_argv.h   4.2 %G%  */
 /*
  * The current implementation of the argument list is poor,
  * using an argv even for internally done "next" commands.
 /*
  * The current implementation of the argument list is poor,
  * using an argv even for internally done "next" commands.