From 6b838b24be835f4dfcc3bb57e63ad678c5569d5d Mon Sep 17 00:00:00 2001 From: Mark Horton Date: Sat, 2 Aug 1980 00:59:04 -0800 Subject: [PATCH] added sccs, Bill put in more buffers 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 | 9 ++- usr/src/usr.bin/ex/ex.h | 3 +- usr/src/usr.bin/ex/ex_addr.c | 108 +---------------------------------- usr/src/usr.bin/ex/ex_argv.h | 3 +- 4 files changed, 14 insertions(+), 109 deletions(-) diff --git a/usr/src/usr.bin/ex/ex.c b/usr/src/usr.bin/ex/ex.c index b10ceb8779..4c46891297 100644 --- a/usr/src/usr.bin/ex/ex.c +++ b/usr/src/usr.bin/ex/ex.c @@ -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" @@ -95,6 +96,9 @@ main(ac, av) 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. @@ -471,6 +475,9 @@ setrupt() preserve() { +#ifdef VMUNIX + tflush(); +#endif synctmp(); pid = fork(); if (pid < 0) diff --git a/usr/src/usr.bin/ex/ex.h b/usr/src/usr.bin/ex/ex.h index c9c0c76b3c..a295ee3b81 100644 --- a/usr/src/usr.bin/ex/ex.h +++ b/usr/src/usr.bin/ex/ex.h @@ -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 #endif diff --git a/usr/src/usr.bin/ex/ex_addr.c b/usr/src/usr.bin/ex/ex_addr.c index afe1b7c119..11a5fb2cfc 100644 --- a/usr/src/usr.bin/ex/ex_addr.c +++ b/usr/src/usr.bin/ex/ex_addr.c @@ -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" @@ -197,108 +198,3 @@ address(inline) 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(); -} diff --git a/usr/src/usr.bin/ex/ex_argv.h b/usr/src/usr.bin/ex/ex_argv.h index 666045b3a5..07c7e20e25 100644 --- a/usr/src/usr.bin/ex/ex_argv.h +++ b/usr/src/usr.bin/ex/ex_argv.h @@ -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. -- 2.20.1