preliminary release 3.6 10/18/80
authorMark Horton <mark@ucbvax.Berkeley.EDU>
Sun, 19 Oct 1980 17:23:25 +0000 (09:23 -0800)
committerMark Horton <mark@ucbvax.Berkeley.EDU>
Sun, 19 Oct 1980 17:23:25 +0000 (09:23 -0800)
SCCS-vsn: usr.bin/ex/bcopy.c 6.1
SCCS-vsn: usr.bin/ex/ex.c 6.1
SCCS-vsn: usr.bin/ex/ex.h 6.1
SCCS-vsn: usr.bin/ex/ex_addr.c 6.1
SCCS-vsn: usr.bin/ex/ex_argv.h 6.1
SCCS-vsn: usr.bin/ex/ex_cmds.c 6.1
SCCS-vsn: usr.bin/ex/ex_cmds2.c 6.1
SCCS-vsn: usr.bin/ex/ex_cmdsub.c 6.1
SCCS-vsn: usr.bin/ex/ex_data.c 6.1
SCCS-vsn: usr.bin/ex/ex_get.c 6.1
SCCS-vsn: usr.bin/ex/ex_io.c 6.1
SCCS-vsn: usr.bin/ex/ex_re.c 6.1
SCCS-vsn: usr.bin/ex/ex_re.h 6.1
SCCS-vsn: usr.bin/ex/ex_set.c 6.1
SCCS-vsn: usr.bin/ex/ex_subr.c 6.1
SCCS-vsn: usr.bin/ex/ex_temp.c 6.1
SCCS-vsn: usr.bin/ex/ex_temp.h 6.1
SCCS-vsn: usr.bin/ex/ex_tty.c 6.1
SCCS-vsn: usr.bin/ex/ex_tty.h 6.1
SCCS-vsn: usr.bin/ex/ex_tune.h 6.1
SCCS-vsn: usr.bin/ex/ex_unix.c 6.1
SCCS-vsn: usr.bin/ex/ex_v.c 6.1
SCCS-vsn: usr.bin/ex/ex_vadj.c 6.1
SCCS-vsn: usr.bin/ex/ex_vars.h 6.1
SCCS-vsn: usr.bin/ex/ex_vget.c 6.1
SCCS-vsn: usr.bin/ex/ex_vis.h 6.1
SCCS-vsn: usr.bin/ex/ex_vmain.c 6.1
SCCS-vsn: usr.bin/ex/ex_voper.c 6.1
SCCS-vsn: usr.bin/ex/ex_vops.c 6.1
SCCS-vsn: usr.bin/ex/ex_vops2.c 6.1
SCCS-vsn: usr.bin/ex/ex_vops3.c 6.1
SCCS-vsn: usr.bin/ex/ex_vwind.c 6.1
SCCS-vsn: usr.bin/ex/ex3.7preserve/ex3.7preserve.c 6.1
SCCS-vsn: usr.bin/ex/ex3.7recover/ex3.7recover.c 6.1
SCCS-vsn: usr.bin/ex/Makefile 6.1
SCCS-vsn: usr.bin/ex/makeoptions 6.1
SCCS-vsn: usr.bin/ex/printf.c 6.1

37 files changed:
usr/src/usr.bin/ex/Makefile
usr/src/usr.bin/ex/bcopy.c
usr/src/usr.bin/ex/ex.c
usr/src/usr.bin/ex/ex.h
usr/src/usr.bin/ex/ex3.7preserve/ex3.7preserve.c
usr/src/usr.bin/ex/ex3.7recover/ex3.7recover.c
usr/src/usr.bin/ex/ex_addr.c
usr/src/usr.bin/ex/ex_argv.h
usr/src/usr.bin/ex/ex_cmds.c
usr/src/usr.bin/ex/ex_cmds2.c
usr/src/usr.bin/ex/ex_cmdsub.c
usr/src/usr.bin/ex/ex_data.c
usr/src/usr.bin/ex/ex_get.c
usr/src/usr.bin/ex/ex_io.c
usr/src/usr.bin/ex/ex_re.c
usr/src/usr.bin/ex/ex_re.h
usr/src/usr.bin/ex/ex_set.c
usr/src/usr.bin/ex/ex_subr.c
usr/src/usr.bin/ex/ex_temp.c
usr/src/usr.bin/ex/ex_temp.h
usr/src/usr.bin/ex/ex_tty.c
usr/src/usr.bin/ex/ex_tty.h
usr/src/usr.bin/ex/ex_tune.h
usr/src/usr.bin/ex/ex_unix.c
usr/src/usr.bin/ex/ex_v.c
usr/src/usr.bin/ex/ex_vadj.c
usr/src/usr.bin/ex/ex_vars.h
usr/src/usr.bin/ex/ex_vget.c
usr/src/usr.bin/ex/ex_vis.h
usr/src/usr.bin/ex/ex_vmain.c
usr/src/usr.bin/ex/ex_voper.c
usr/src/usr.bin/ex/ex_vops.c
usr/src/usr.bin/ex/ex_vops2.c
usr/src/usr.bin/ex/ex_vops3.c
usr/src/usr.bin/ex/ex_vwind.c
usr/src/usr.bin/ex/makeoptions
usr/src/usr.bin/ex/printf.c

index e5f968b..8869b60 100644 (file)
@@ -25,12 +25,12 @@ LIBDIR=     /usr/lib
 FOLD=  ${BINDIR}/fold
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
 FOLD=  ${BINDIR}/fold
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
-DEBUGFLAGS=    -DTRACE -g
+DEBUGFLAGS=    -DMDEBUG -DTRACE -g
 NONDEBUGFLAGS= -O
 DEB=   ${NONDEBUGFLAGS}        # or ${DEBUGFLAGS} to to debug
 NONDEBUGFLAGS= -O
 DEB=   ${NONDEBUGFLAGS}        # or ${DEBUGFLAGS} to to debug
-CFLAGS=        -DTABS=8 -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX ${DEB}
+CFLAGS=        -DTABS=8 -DCRYPT -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX -DTIMEBOMB ${DEB}
 LDFLAGS=       -z              # or -i or -n
 LDFLAGS=       -z              # or -i or -n
-TERMLIB=       -ltermlib
+TERMLIB=       -ltermcap
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
@@ -38,14 +38,14 @@ PR= pr
 OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
        ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \
        ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
 OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
        ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \
        ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
-       ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
+       ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
        printf.o bcopy.o strings.o
 HDRS=  ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
 SRC1=  ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
 SRC2=  ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
 SRC3=  ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
        printf.o bcopy.o strings.o
 HDRS=  ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
 SRC1=  ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
 SRC2=  ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
 SRC3=  ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
-SRC4=  ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voperate.c
+SRC4=  ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
 SRC5=  ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
 SRC6=  printf.c bcopy.c expreserve.c exrecover.c
 MISC=  makefile READ_ME :rofix
 SRC5=  ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
 SRC6=  printf.c bcopy.c expreserve.c exrecover.c
 MISC=  makefile READ_ME :rofix
@@ -53,9 +53,13 @@ VGRIND=      csh /usr/ucb/vgrind
 VHDR=  "Ex Version ${VERSION}"
 
 .c.o:
 VHDR=  "Ex Version ${VERSION}"
 
 .c.o:
-#      ${MKSTR} - ex${VERSION}strings x $*.c
+# ifdef VMUNIX
        ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
        ${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
+# else
+#      ${MKSTR} - ex${VERSION}strings x $*.c
+#      ${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
 #      rm -f x$*.c
 #      rm -f x$*.c
+# endif
        ${CC} ${CFLAGS} -c x.c 
        mv x.o $*.o
 
        ${CC} ${CFLAGS} -c x.c 
        mv x.o $*.o
 
@@ -111,6 +115,7 @@ ninstall: a.out
 
 # install in standard place (/usr/ucb)
 install: a.out exrecover expreserve
 
 # install in standard place (/usr/ucb)
 install: a.out exrecover expreserve
+       strip a.out
        -rm -f ${DESTDIR}${BINDIR}/ex
        -rm -f ${DESTDIR}${BINDIR}/vi
        -rm -f ${DESTDIR}${BINDIR}/view
        -rm -f ${DESTDIR}${BINDIR}/ex
        -rm -f ${DESTDIR}${BINDIR}/vi
        -rm -f ${DESTDIR}${BINDIR}/view
@@ -129,7 +134,7 @@ install: a.out exrecover expreserve
        cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
        chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
 # The following line normally fails.  This is OK.
        cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
        chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
 # The following line normally fails.  This is OK.
-       mkdir ${DESTDIR}/usr/preserve
+       -mkdir ${DESTDIR}/usr/preserve
 
 # move from /usr/new to /usr/ucb
 newucb: a.out
 
 # move from /usr/new to /usr/ucb
 newucb: a.out
@@ -176,42 +181,3 @@ vgrind:
        ${VGRIND} -h ${VHDR} ${SRC6}
        ${VGRIND} -n -h ${VHDR} ${MISC}
        ${VGRIND} -i -h ${VHDR} index
        ${VGRIND} -h ${VHDR} ${SRC6}
        ${VGRIND} -n -h ${VHDR} ${MISC}
        ${VGRIND} -i -h ${VHDR} index
-
-ex.c: SCCS/s.ex.c ${HDRS}; rm -f ex.c; sccs get ex.c 
-ex.h: SCCS/s.ex.h; rm -f ex.h; sccs get ex.h 
-ex_addr.c: SCCS/s.ex_addr.c; rm -f ex_addr.c; sccs get ex_addr.c 
-ex_argv.h: SCCS/s.ex_argv.h; rm -f ex_argv.h; sccs get ex_argv.h 
-ex_cmds.c: SCCS/s.ex_cmds.c; rm -f ex_cmds.c; sccs get ex_cmds.c 
-ex_cmds2.c: SCCS/s.ex_cmds2.c; rm -f ex_cmds2.c; sccs get ex_cmds2.c 
-ex_cmdsub.c: SCCS/s.ex_cmdsub.c; rm -f ex_cmdsub.c; sccs get ex_cmdsub.c 
-ex_data.c: SCCS/s.ex_data.c; rm -f ex_data.c; sccs get ex_data.c 
-ex_get.c: SCCS/s.ex_get.c; rm -f ex_get.c; sccs get ex_get.c 
-ex_io.c: SCCS/s.ex_io.c; rm -f ex_io.c; sccs get ex_io.c 
-ex_put.c: SCCS/s.ex_put.c; rm -f ex_put.c; sccs get ex_put.c 
-ex_re.c: SCCS/s.ex_re.c; rm -f ex_re.c; sccs get ex_re.c 
-ex_re.h: SCCS/s.ex_re.h; rm -f ex_re.h; sccs get ex_re.h 
-ex_set.c: SCCS/s.ex_set.c; rm -f ex_set.c; sccs get ex_set.c 
-ex_subr.c: SCCS/s.ex_subr.c; rm -f ex_subr.c; sccs get ex_subr.c 
-ex_temp.c: SCCS/s.ex_temp.c; rm -f ex_temp.c; sccs get ex_temp.c 
-ex_temp.h: SCCS/s.ex_temp.h; rm -f ex_temp.h; sccs get ex_temp.h 
-ex_tty.c: SCCS/s.ex_tty.c; rm -f ex_tty.c; sccs get ex_tty.c 
-ex_tty.h: SCCS/s.ex_tty.h; rm -f ex_tty.h; sccs get ex_tty.h 
-ex_tune.h: SCCS/s.ex_tune.h; rm -f ex_tune.h; sccs get ex_tune.h 
-ex_unix.c: SCCS/s.ex_unix.c; rm -f ex_unix.c; sccs get ex_unix.c
-ex_v.c: SCCS/s.ex_v.c; rm -f ex_v.c; sccs get ex_v.c 
-ex_vadj.c: SCCS/s.ex_vadj.c; rm -f ex_vadj.c; sccs get ex_vadj.c 
-ex_vars.h: SCCS/s.ex_vars.h; rm -f ex_vars.h; sccs get ex_vars.h 
-ex_vget.c: SCCS/s.ex_vget.c; rm -f ex_vget.c; sccs get ex_vget.c 
-ex_vis.h: SCCS/s.ex_vis.h; rm -f ex_vis.h; sccs get ex_vis.h 
-ex_vmain.c: SCCS/s.ex_vmain.c; rm -f ex_vmain.c; sccs get ex_vmain.c 
-ex_voperate.c: SCCS/s.ex_voperate.c; rm -f ex_voperate.c; sccs get ex_voperate.c
-ex_vops.c: SCCS/s.ex_vops.c; rm -f ex_vops.c; sccs get ex_vops.c 
-ex_vops2.c: SCCS/s.ex_vops2.c; rm -f ex_vops2.c; sccs get ex_vops2.c 
-ex_vops3.c: SCCS/s.ex_vops3.c; rm -f ex_vops3.c; sccs get ex_vops3.c 
-ex_vput.c: SCCS/s.ex_vput.c; rm -f ex_vput.c; sccs get ex_vput.c 
-ex_vwind.c: SCCS/s.ex_vwind.c; rm -f ex_vwind.c; sccs get ex_vwind.c 
-expreserve.c: SCCS/s.expreserve.c; rm -f expreserve.c; sccs get expreserve.c 
-exrecover.c: SCCS/s.exrecover.c; rm -f exrecover.c; sccs get exrecover.c 
-makeoptions: SCCS/s.makeoptions; rm -f makeoptions; sccs get makeoptions 
-bcopy.c: SCCS/s.bcopy.c; rm -f bcopy.c; sccs get bcopy.c
-printf.c: SCCS/s.printf.c; rm -f printf.c; sccs get printf.c 
index f56da4b..a245bb2 100644 (file)
@@ -1,5 +1,5 @@
 /* block copy from from to to, count bytes */
 /* block copy from from to to, count bytes */
-static char *sccsid = "@(#)bcopy.c     5.1 %G%";
+static char *sccsid = "@(#)bcopy.c     6.1 %G%";
 bcopy(from, to, count)
 #ifdef vax
        char *from, *to;
 bcopy(from, to, count)
 #ifdef vax
        char *from, *to;
index 2addbf2..a2f4de8 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.c        5.3 %G%";
+static char *sccsid = "@(#)ex.c        6.1 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -143,10 +143,6 @@ main(ac, av)
        ruptible = signal(SIGINT, SIG_IGN) == SIG_DFL;
        if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
                signal(SIGTERM, onhup);
        ruptible = signal(SIGINT, SIG_IGN) == SIG_DFL;
        if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
                signal(SIGTERM, onhup);
-#ifdef SIGTSTP
-       if (signal(SIGTSTP, SIG_IGN) == SIG_DFL)
-               signal(SIGTSTP, onsusp), dosusp++;
-#endif
 
        /*
         * Initialize end of core pointers.
 
        /*
         * Initialize end of core pointers.
@@ -239,6 +235,12 @@ main(ac, av)
                }
                ac--, av++;
        }
                }
                ac--, av++;
        }
+
+#ifdef SIGTSTP
+       if (!hush && signal(SIGTSTP, SIG_IGN) == SIG_DFL)
+               signal(SIGTSTP, onsusp), dosusp++;
+#endif
+
        if (ac && av[0][0] == '+') {
                firstpat = &av[0][1];
                ac--, av++;
        if (ac && av[0][0] == '+') {
                firstpat = &av[0][1];
                ac--, av++;
@@ -281,7 +283,6 @@ main(ac, av)
         * Initialize a temporary file (buffer) and
         * set up terminal environment.  Read user startup commands.
         */
         * Initialize a temporary file (buffer) and
         * set up terminal environment.  Read user startup commands.
         */
-       init();
        if (setexit() == 0) {
                setrupt();
                intty = isatty(0);
        if (setexit() == 0) {
                setrupt();
                intty = isatty(0);
@@ -304,6 +305,7 @@ main(ac, av)
                        if ((cp = getenv("HOME")) != 0 && *cp)
                                source(strcat(strcpy(genbuf, cp), "/.exrc"), 1);
                }
                        if ((cp = getenv("HOME")) != 0 && *cp)
                                source(strcat(strcpy(genbuf, cp), "/.exrc"), 1);
                }
+       init(); /* moved after prev 2 chunks to fix directory option */
 
        /*
         * Initial processing.  Handle tag, recover, and file argument
 
        /*
         * Initial processing.  Handle tag, recover, and file argument
@@ -350,6 +352,7 @@ main(ac, av)
         * If you quit out of a 'vi' command by doing Q or ^\,
         * you also fall through to here.
         */
         * If you quit out of a 'vi' command by doing Q or ^\,
         * you also fall through to here.
         */
+       seenprompt = 1;
        ungetchar(0);
        globp = 0;
        initev = 0;
        ungetchar(0);
        globp = 0;
        initev = 0;
index e7b7132..5e93196 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex.h        5.1 %G%  */
+/* sccs id:    @(#)ex.h        6.1 %G%  */
 #ifdef V6
 #include <retrofit.h>
 #endif
 #ifdef V6
 #include <retrofit.h>
 #endif
@@ -204,12 +204,14 @@ int       ppid;                   /* Process id of parent (e.g. main ex proc) */
 jmp_buf        resetlab;               /* For error throws to top level (cmd mode) */
 int    rpid;                   /* Pid returned from wait() */
 bool   ruptible;               /* Interruptible is normal state */
 jmp_buf        resetlab;               /* For error throws to top level (cmd mode) */
 int    rpid;                   /* Pid returned from wait() */
 bool   ruptible;               /* Interruptible is normal state */
+bool   seenprompt;             /* 1 if have gotten user input */
 bool   shudclob;               /* Have a prompt to clobber (e.g. on ^D) */
 int    status;                 /* Status returned from wait() */
 int    tchng;                  /* If nonzero, then [Modified] */
 short  tfile;                  /* Temporary file unit */
 bool   vcatch;                 /* Want to catch an error (open/visual) */
 jmp_buf        vreslab;                /* For error throws to a visual catch */
 bool   shudclob;               /* Have a prompt to clobber (e.g. on ^D) */
 int    status;                 /* Status returned from wait() */
 int    tchng;                  /* If nonzero, then [Modified] */
 short  tfile;                  /* Temporary file unit */
 bool   vcatch;                 /* Want to catch an error (open/visual) */
 jmp_buf        vreslab;                /* For error throws to a visual catch */
+bool   writing;                /* 1 if in middle of a file write */
 int    xchng;                  /* Suppresses multiple "No writes" in !cmd */
 
 /*
 int    xchng;                  /* Suppresses multiple "No writes" in !cmd */
 
 /*
index ee2344d..ccac639 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 = "@(#)ex3.7preserve.c     5.1 %G%";
+static char *sccsid = "@(#)ex3.7preserve.c     6.1 %G%";
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
@@ -172,7 +172,7 @@ copyout(name)
        if (read(0, (char *) &H, sizeof H) != sizeof H) {
 format:
                if (name == 0)
        if (read(0, (char *) &H, sizeof H) != sizeof H) {
 format:
                if (name == 0)
-                       fprintf(stderr, "Buffer format error\n");
+                       fprintf(stderr, "Buffer format error\t");
                return (-1);
        }
 
                return (-1);
        }
 
@@ -289,7 +289,7 @@ whoops:
                if (dcp[-1] == 'z') {
                        dcp[-1] = 'a';
                        if (dcp[-2] == 'z')
                if (dcp[-1] == 'z') {
                        dcp[-1] = 'a';
                        if (dcp[-2] == 'z')
-                               fprintf(stderr, "Can't find a name\n");
+                               fprintf(stderr, "Can't find a name\t");
                        dcp[-2]++;
                } else
                        dcp[-1]++;
                        dcp[-2]++;
                } else
                        dcp[-1]++;
@@ -320,13 +320,18 @@ notify(uid, fname, flag)
        if (fname[0] == 0) {
                fprintf(mf,
 "A copy of an editor buffer of yours was saved when %s.\n",
        if (fname[0] == 0) {
                fprintf(mf,
 "A copy of an editor buffer of yours was saved when %s.\n",
-               flag ? "the system went down" : "your phone was hung up");
+               flag ? "the system went down" : "the editor was killed");
                fprintf(mf,
 "No name was associated with this buffer so it has been named \"LOST\".\n");
        } else
                fprintf(mf,
 "A copy of an editor buffer of your file \"%s\"\nwas saved when %s.\n", fname,
                fprintf(mf,
 "No name was associated with this buffer so it has been named \"LOST\".\n");
        } else
                fprintf(mf,
 "A copy of an editor buffer of your file \"%s\"\nwas saved when %s.\n", fname,
-               flag ? "the system went down" : "your phone was hung up");
+               /*
+                * "the editor was killed" is perhaps still not an ideal
+                * error message.  Usually, either it was forcably terminated
+                * or the phone was hung up, but we don't know which.
+                */
+               flag ? "the system went down" : "the editor was killed");
        fprintf(mf,
 "This buffer can be retrieved using the \"recover\" command of the editor.\n");
        fprintf(mf,
        fprintf(mf,
 "This buffer can be retrieved using the \"recover\" command of the editor.\n");
        fprintf(mf,
index aa7b1a2..97a23e6 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 = "@(#)ex3.7recover.c      5.1 %G%";
+static char *sccsid = "@(#)ex3.7recover.c      6.1 %G%";
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
index bd36495..81d3032 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1979 Regents of the University of California */
 /* Copyright (c) 1979 Regents of the University of California */
-static char *sccsid = "@(#)ex_addr.c   5.1 %G%";
+static char *sccsid = "@(#)ex_addr.c   6.1 %G%";
 #include "ex.h"
 #include "ex_re.h"
 
 #include "ex.h"
 #include "ex_re.h"
 
index e4dfc00..963eda2 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex_argv.h   5.1 %G%  */
+/* sccs id:    @(#)ex_argv.h   6.1 %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.
index 962449f..dc0ba6a 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.3 %G%";
+static char *sccsid = "@(#)ex_cmds.c   6.1 %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);
@@ -562,8 +558,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 +569,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 +654,7 @@ quit:
 /* version */
                                tail("version");
                                setNAEOL();
 /* version */
                                tail("version");
                                setNAEOL();
-                               printf("@(#) Version 3.5, %G%."+5);
+                               printf("@(#) Version 3.6, %G%. (EXPERIMENTAL version 3.6, Oct 1980)"+5);
                                noonl();
                                continue;
 
                                noonl();
                                continue;
 
index 1ca1a6e..ba014c5 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_cmds2.c  5.1 %G%";
+static char *sccsid = "@(#)ex_cmds2.c  6.1 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -74,6 +74,10 @@ error(str, i)
 
        error0();
        merror(str, i);
 
        error0();
        merror(str, i);
+       if (writing) {
+               serror(" [Warning - %s is incomplete]", file);
+               writing = 0;
+       }
        error1(str);
 }
 
        error1(str);
 }
 
index 268e8ed..d90aa95 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_cmdsub.c 5.1 %G%";
+static char *sccsid = "@(#)ex_cmdsub.c 6.1 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -107,6 +107,10 @@ delete(hush)
        if(FIXUNDO) {
                register int (*dsavint)();
 
        if(FIXUNDO) {
                register int (*dsavint)();
 
+#ifdef TRACE
+               if (trace)
+                       vudump("before delete");
+#endif
                change();
                dsavint = signal(SIGINT, SIG_IGN);
                undkind = UNDCHANGE;
                change();
                dsavint = signal(SIGINT, SIG_IGN);
                undkind = UNDCHANGE;
@@ -125,6 +129,10 @@ delete(hush)
                dot = a1;
                pkill[0] = pkill[1] = 0;
                signal(SIGINT, dsavint);
                dot = a1;
                pkill[0] = pkill[1] = 0;
                signal(SIGINT, dsavint);
+#ifdef TRACE
+               if (trace)
+                       vudump("after delete");
+#endif
        } else {
                register line *a3;
                register int i;
        } else {
                register line *a3;
                register int i;
@@ -543,8 +551,12 @@ badtag:
                        mid = (top + bot) / 2;
                        fseek(iof, mid, 0);
                        if (mid > 0)    /* to get first tag in file to work */
                        mid = (top + bot) / 2;
                        fseek(iof, mid, 0);
                        if (mid > 0)    /* to get first tag in file to work */
-                               fgets(linebuf, sizeof linebuf, iof);    /* scan to next \n */
-                       fgets(linebuf, sizeof linebuf, iof);    /* get a line */
+                               /* scan to next \n */
+                               if(fgets(linebuf, sizeof linebuf, iof)==NULL)
+                                       goto goleft;
+                       /* get the line itself */
+                       if(fgets(linebuf, sizeof linebuf, iof)==NULL)
+                               goto goleft;
                        linebuf[strlen(linebuf)-1] = 0; /* was '\n' */
 #endif
                        while (*cp && *lp == *cp)
                        linebuf[strlen(linebuf)-1] = 0; /* was '\n' */
 #endif
                        while (*cp && *lp == *cp)
@@ -554,6 +566,7 @@ badtag:
                                if (*lp > *cp)
                                        bot = mid + 1;
                                else
                                if (*lp > *cp)
                                        bot = mid + 1;
                                else
+goleft:
                                        top = mid - 1;
 #endif
                                /* Not this tag.  Try the next */
                                        top = mid - 1;
 #endif
                                /* Not this tag.  Try the next */
index 93a689a..355feda 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_data.c   5.1 %G%";
+static char *sccsid = "@(#)ex_data.c   6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 
 #include "ex.h"
 #include "ex_tty.h"
 
index 843cfef..9f41fab 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_get.c    5.1 %G%";
+static char *sccsid = "@(#)ex_get.c    6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 
 #include "ex.h"
 #include "ex_tty.h"
 
index 852b4e3..a4f969e 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_io.c     5.6 %G%";
+static char *sccsid = "@(#)ex_io.c     6.1 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -309,8 +309,19 @@ rop(c)
 
        io = open(file, 0);
        if (io < 0) {
 
        io = open(file, 0);
        if (io < 0) {
-               if (c == 'e' && errno == ENOENT)
+               if (c == 'e' && errno == ENOENT) {
                        edited++;
                        edited++;
+                       /*
+                        * If the user just did "ex foo" he is probably
+                        * creating a new file.  Don't be an error, since
+                        * this is ugly, and it screws up the + option.
+                        */
+                       if (!seenprompt) {
+                               printf(" [New file]");
+                               noonl();
+                               return;
+                       }
+               }
                syserror();
        }
        if (fstat(io, &stbuf))
                syserror();
        }
        if (fstat(io, &stbuf))
@@ -357,14 +368,16 @@ rop(c)
                        break;
                }
        }
                        break;
                }
        }
-       if (value(READONLY) && denied) {
-               value(READONLY) = ovro;
-               denied = 0;
-       }
-       if (c != 'r' && ((stbuf.st_mode & 0222) == 0 || access(file, 2) < 0)) {
-               ovro = value(READONLY);
-               denied = 1;
-               value(READONLY) = 1;
+       if (c != 'r') {
+               if (value(READONLY) && denied) {
+                       value(READONLY) = ovro;
+                       denied = 0;
+               }
+               if ((stbuf.st_mode & 0222) == 0 || access(file, 2) < 0) {
+                       ovro = value(READONLY);
+                       denied = 1;
+                       value(READONLY) = 1;
+               }
        }
        if (value(READONLY)) {
                printf(" [Read only]");
        }
        if (value(READONLY)) {
                printf(" [Read only]");
@@ -532,6 +545,7 @@ cre:
 #endif
                if (io < 0)
                        syserror();
 #endif
                if (io < 0)
                        syserror();
+               writing = 1;
                if (hush == 0)
                        if (nonexist)
                                printf(" [New file]");
                if (hush == 0)
                        if (nonexist)
                                printf(" [New file]");
@@ -560,6 +574,7 @@ cre:
                addr1 = saddr1;
                addr2 = saddr2;
        }
                addr1 = saddr1;
                addr2 = saddr2;
        }
+       writing = 0;
 }
 
 /*
 }
 
 /*
@@ -711,9 +726,13 @@ source(fil, okfail)
 {
        jmp_buf osetexit;
        register int saveinp, ointty, oerrno;
 {
        jmp_buf osetexit;
        register int saveinp, ointty, oerrno;
+       char savepeekc, *saveglobp;
 
        signal(SIGINT, SIG_IGN);
        saveinp = dup(0);
 
        signal(SIGINT, SIG_IGN);
        saveinp = dup(0);
+       savepeekc = peekc;
+       saveglobp = globp;
+       peekc = 0; globp = 0;
        if (saveinp < 0)
                error("Too many nested sources");
        if (slevel <= 0)
        if (saveinp < 0)
                error("Too many nested sources");
        if (slevel <= 0)
@@ -751,6 +770,8 @@ source(fil, okfail)
        close(0);
        dup(saveinp);
        close(saveinp);
        close(0);
        dup(saveinp);
        close(saveinp);
+       globp = saveglobp;
+       peekc = savepeekc;
        slevel--;
        resexit(osetexit);
 }
        slevel--;
        resexit(osetexit);
 }
index 013a2de..1d4677c 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_re.c     5.1 %G%";
+static char *sccsid = "@(#)ex_re.c     6.1 %G%";
 #include "ex.h"
 #include "ex_re.h"
 
 #include "ex.h"
 #include "ex_re.h"
 
@@ -81,9 +81,22 @@ out:
                if (a1 >= addr1 && a1 <= addr2 && execute(0, a1) == k)
                        *a1 |= 01;
        }
                if (a1 >= addr1 && a1 <= addr2 && execute(0, a1) == k)
                        *a1 |= 01;
        }
-       /* should use gdelete from ed to avoid n**2 here on g/.../d */
+       /*
+        * Special case: g/.../d (avoid n^2 algorithm)
+        */
+       if (globuf[0]=='d' && globuf[1]=='\n' && globuf[2]=='\0') {
+               gdelete();
+               return;
+       }
        if (inopen)
                inopen = -1;
        if (inopen)
                inopen = -1;
+       /*
+        * Now for each marked line, set dot there and do the commands.
+        * Note the n^2 behavior here for lots of lines matching.
+        * This is really needed: in some cases you could delete lines,
+        * causing a marked line to be moved before a1 and missed if
+        * we didn't restart at zero each time.
+        */
        for (a1 = one; a1 <= dol; a1++) {
                if (*a1 & 01) {
                        *a1 &= ~01;
        for (a1 = one; a1 <= dol; a1++) {
                if (*a1 & 01) {
                        *a1 &= ~01;
@@ -105,6 +118,37 @@ out:
        }
 }
 
        }
 }
 
+/*
+ * gdelete: delete inside a global command. Handles the
+ * special case g/r.e./d. All lines to be deleted have
+ * already been marked. Squeeze the remaining lines together.
+ * Note that other cases such as g/r.e./p, g/r.e./s/r.e.2/rhs/,
+ * and g/r.e./.,/r.e.2/d are not treated specially.  There is no
+ * good reason for this except the question: where to you draw the line?
+ */
+gdelete()
+{
+       register line *a1, *a2, *a3;
+
+       a3 = dol;
+       /* find first marked line. can skip all before it */
+       for (a1=zero; (*a1&01)==0; a1++)
+               if (a1>=a3)
+                       return;
+       /* copy down unmarked lines, compacting as we go. */
+       for (a2=a1+1; a2<=a3;) {
+               if (*a2&01) {
+                       a2++;           /* line is marked, skip it */
+                       dot = a1;       /* dot left after line deletion */
+               } else
+                       *a1++ = *a2++;  /* unmarked, copy it */
+       }
+       dol = a1-1;
+       if (dot>dol)
+               dot = dol;
+       change();
+}
+
 bool   cflag;
 int    scount, slines, stotal;
 
 bool   cflag;
 int    scount, slines, stotal;
 
@@ -113,7 +157,7 @@ substitute(c)
 {
        register line *addr;
        register int n;
 {
        register line *addr;
        register int n;
-       int gsubf;
+       int gsubf, hopcount = 0;
 
        gsubf = compsub(c);
        if(FIXUNDO)
 
        gsubf = compsub(c);
        if(FIXUNDO)
@@ -125,17 +169,16 @@ substitute(c)
                if (dosubcon(0, addr) == 0)
                        continue;
                if (gsubf) {
                if (dosubcon(0, addr) == 0)
                        continue;
                if (gsubf) {
-#ifdef notdef
                        /*
                        /*
-                        * should check but loc2 is already munged.
-                        * This needs a fancier check later.
+                        * The loop can happen from s/\</&/g
+                        * but we don't want to break other, reasonable cases.
                         */
                         */
-                       if (loc1 == loc2)
-                               error("substitution loop");
-#endif
-                       while (*loc2)
+                       while (*loc2) {
+                               if (++hopcount > sizeof linebuf)
+                                       error("substitution loop");
                                if (dosubcon(1, addr) == 0)
                                        break;
                                if (dosubcon(1, addr) == 0)
                                        break;
+                       }
                }
                if (scount) {
                        stotal += scount;
                }
                if (scount) {
                        stotal += scount;
@@ -223,7 +266,7 @@ comprhs(seof)
 {
        register char *rp, *orp;
        register int c;
 {
        register char *rp, *orp;
        register int c;
-       char orhsbuf[LBSIZE / 2];
+       char orhsbuf[RHSSIZE];
 
        rp = rhsbuf;
        CP(orhsbuf, rp);
 
        rp = rhsbuf;
        CP(orhsbuf, rp);
@@ -251,7 +294,7 @@ comprhs(seof)
 magic:
                        if (c == '~') {
                                for (orp = orhsbuf; *orp; *rp++ = *orp++)
 magic:
                        if (c == '~') {
                                for (orp = orhsbuf; *orp; *rp++ = *orp++)
-                                       if (rp >= &rhsbuf[LBSIZE / 2 + 1])
+                                       if (rp >= &rhsbuf[RHSSIZE - 1])
                                                goto toobig;
                                continue;
                        }
                                                goto toobig;
                                continue;
                        }
@@ -271,9 +314,11 @@ magic:
                                goto magic;
                        break;
                }
                                goto magic;
                        break;
                }
-               if (rp >= &rhsbuf[LBSIZE / 2 - 1])
+               if (rp >= &rhsbuf[RHSSIZE - 1]) {
 toobig:
 toobig:
+                       *rp = 0;
                        error("Replacement pattern too long@- limit 256 characters");
                        error("Replacement pattern too long@- limit 256 characters");
+               }
                *rp++ = c;
        }
 endrhs:
                *rp++ = c;
        }
 endrhs:
index 295cab4..9fcb977 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex_re.h     5.1 %G%  */
+/* sccs id:    @(#)ex_re.h     6.1 %G%  */
 /*
  * Regular expression definitions.
  * The regular expressions in ex are similar to those in ed,
 /*
  * Regular expression definitions.
  * The regular expressions in ex are similar to those in ed,
index f74e411..2b39eff 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_set.c    5.1 %G%";
+static char *sccsid = "@(#)ex_set.c    6.1 %G%";
 #include "ex.h"
 #include "ex_temp.h"
 
 #include "ex.h"
 #include "ex_temp.h"
 
index 93dea19..3cb8c92 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_subr.c   5.1 %G%";
+static char *sccsid = "@(#)ex_subr.c   6.1 %G%";
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
@@ -541,7 +541,7 @@ save(a1, a2)
        more = (a2 - a1 + 1) - (unddol - dol);
        while (more > (endcore - truedol))
                if (morelines() < 0)
        more = (a2 - a1 + 1) - (unddol - dol);
        while (more > (endcore - truedol))
                if (morelines() < 0)
-                       error("Out of memory@saving lines for undo - try using ed or re");
+                       error("Out of memory@saving lines for undo - try using ed");
        if (more)
                (*(more > 0 ? copywR : copyw))(unddol + more + 1, unddol + 1,
                    (truedol - unddol));
        if (more)
                (*(more > 0 ? copywR : copyw))(unddol + more + 1, unddol + 1,
                    (truedol - unddol));
@@ -698,6 +698,7 @@ syserror()
 
        dirtcnt = 0;
        putchar(' ');
 
        dirtcnt = 0;
        putchar(' ');
+       edited = 0;     /* for temp file errors, for example */
        if (e >= 0 && errno <= std_nerrs)
                error(std_errlist[e]);
        else
        if (e >= 0 && errno <= std_nerrs)
                error(std_errlist[e]);
        else
index d40b43f..147b66d 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_temp.c   5.1 %G%";
+static char *sccsid = "@(#)ex_temp.c   6.1 %G%";
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_vis.h"
index 6c623bc..40bd34b 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex_temp.h   5.1 %G%  */
+/* sccs id:    @(#)ex_temp.h   6.1 %G%  */
 /*
  * The editor uses a temporary file for files being edited, in a structure
  * similar to that of ed.  The first block of the file is used for a header
 /*
  * The editor uses a temporary file for files being edited, in a structure
  * similar to that of ed.  The first block of the file is used for a header
index bc4d094..1bdf091 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_tty.c    5.1 %G%";
+static char *sccsid = "@(#)ex_tty.c    6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 
 #include "ex.h"
 #include "ex_tty.h"
 
@@ -119,7 +119,9 @@ setterm(type)
        if (tgoto(CM, 2, 2)[0] == 'O')  /* OOPS */
                CA = 0, CM = 0;
        else
        if (tgoto(CM, 2, 2)[0] == 'O')  /* OOPS */
                CA = 0, CM = 0;
        else
-               CA = 1, costCM = strlen(tgoto(CM, 8, 10));
+               CA = 1, costCM = cost(tgoto(CM, 8, 10));
+       costSR = cost(SR);
+       costAL = cost(AL);
        PC = xPC ? xPC[0] : 0;
        aoftspace = tspace;
        CP(ttytype, longname(ltcbuf, type));
        PC = xPC ? xPC[0] : 0;
        aoftspace = tspace;
        CP(ttytype, longname(ltcbuf, type));
@@ -130,6 +132,8 @@ setterm(type)
        gettmode();
        value(REDRAW) = AL && DL;
        value(OPTIMIZE) = !CA && !GT;
        gettmode();
        value(REDRAW) = AL && DL;
        value(OPTIMIZE) = !CA && !GT;
+       if (ospeed == B1200 && !value(REDRAW))
+               value(SLOWOPEN) = 1;    /* see also gettmode above */
        if (unknown)
                serror("%s: Unknown terminal type", type);
 }
        if (unknown)
                serror("%s: Unknown terminal type", type);
 }
@@ -183,3 +187,33 @@ fkey(i)
        else
                return(NOSTR);
 }
        else
                return(NOSTR);
 }
+
+/*
+ * cost figures out how much (in characters) it costs to send the string
+ * str to the terminal.  It takes into account padding information, as
+ * much as it can, for a typical case.  (Right now the typical case assumes
+ * the number of lines affected is the size of the screen, since this is
+ * mainly used to decide if AL or SR is better, and this always happens
+ * at the top of the screen.  We assume cursor motion (CM) has little
+ * padding, if any, required, so that case, which is really more important
+ * than AL vs SR, won't be really affected.)
+ */
+static int costnum;
+cost(str)
+char *str;
+{
+       int countnum();
+
+       if (str == NULL)
+               return 10000;   /* infinity */
+       costnum = 0;
+       tputs(str, LINES, countnum);
+       return costnum;
+}
+
+/* ARGSUSED */
+countnum(ch)
+char ch;
+{
+       costnum++;
+}
index d288f47..f4dd64c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex_tty.h    5.1 %G%  */
+/* sccs id:    @(#)ex_tty.h    6.1 %G%  */
 /*
  * Capabilities from termcap
  *
 /*
  * Capabilities from termcap
  *
@@ -148,7 +148,9 @@ ttymode ostart(), setty(), unixex();
 short  WBOT;
 short  WECHO;
 
 short  WBOT;
 short  WECHO;
 
-short  costCM;
+short  costCM; /* # chars to output a typical CM, with padding etc. */
+short  costSR; /* likewise */
+short  costAL;
 
 #ifdef VMUNIX
 # define MAXNOMACS     128     /* max number of macros of each kind */
 
 #ifdef VMUNIX
 # define MAXNOMACS     128     /* max number of macros of each kind */
index 72be621..c4949ab 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex_tune.h   5.1 %G%  */
+/* sccs id:    @(#)ex_tune.h   6.1 %G%  */
 /*
  * Definitions of editor parameters and limits
  */
 /*
  * Definitions of editor parameters and limits
  */
  * "/usr/lib/..." here, "/lib" will be tried only for strings.
  */
 #include "local/uparm.h"
  * "/usr/lib/..." here, "/lib" will be tried only for strings.
  */
 #include "local/uparm.h"
-#define        EXRECOVER       libpath(ex3.5recover)
-#define        EXPRESERVE      libpath(ex3.5preserve)
+#define        EXRECOVER       libpath(ex3.6recover)
+#define        EXPRESERVE      libpath(ex3.6preserve)
 #ifndef VMUNIX
 #ifndef VMUNIX
-#define        EXSTRINGS       libpath(ex3.5strings)
+#define        EXSTRINGS       libpath(ex3.6strings)
 #endif
 
 /*
 #endif
 
 /*
index 369eb4b..416ff26 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1979 Regents of the University of California */
 /* Copyright (c) 1979 Regents of the University of California */
-static char *sccsid = "@(#)ex_unix.c   5.2 %G%";
+static char *sccsid = "@(#)ex_unix.c   6.1 %G%";
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
@@ -267,6 +267,10 @@ filter(mode)
                if(FIXUNDO)
                        undap1 = undap2 = addr2+1;
                ignore(append(getfile, addr2));
                if(FIXUNDO)
                        undap1 = undap2 = addr2+1;
                ignore(append(getfile, addr2));
+#ifdef TRACE
+               if (trace)
+                       vudump("after append in filter");
+#endif
        }
        close(io);
        io = -1;
        }
        close(io);
        io = -1;
index a770ee5..8f4b1a4 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_v.c      5.1 %G%";
+static char *sccsid = "@(#)ex_v.c      6.1 %G%";
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
index e0d3add..599a26e 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_vadj.c   5.1 %G%";
+static char *sccsid = "@(#)ex_vadj.c   6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -242,21 +242,11 @@ vinslin(p, cnt, l)
                vgoto(p, 0), vputp(CD, cnt);
                vclrech(1);
                vadjAL(p, cnt);
                vgoto(p, 0), vputp(CD, cnt);
                vclrech(1);
                vadjAL(p, cnt);
-       } else if (AL) {
-               /*
-                * Use insert line.
-                */
-               vgoto(p, 0), vputp(AL, WECHO + 1 - p);
-               for (i = cnt - 1; i > 0; i--) {
-                       vgoto(outline+1, 0), vputp(AL, WECHO + 1 - outline);
-                       if ((hold & HOLDAT) == 0)
-                               putchar('@');
-               }
-               vadjAL(p, cnt);
-       } else if (SR && p == WTOP) {
+       } else if (SR && p == WTOP && costSR < costAL) {
                /*
                 * Use reverse scroll mode of the terminal, at
                /*
                 * Use reverse scroll mode of the terminal, at
-                * the top of the window.
+                * the top of the window.  Reverse linefeed works
+                * too, since we only use it from line WTOP.
                 */
                for (i = cnt; i > 0; i--) {
                        vgoto(p, 0), vputp(SR, 0);
                 */
                for (i = cnt; i > 0; i--) {
                        vgoto(p, 0), vputp(SR, 0);
@@ -273,6 +263,17 @@ vinslin(p, cnt, l)
                                vputp(CE, 1);
                }
                vadjAL(p, cnt);
                                vputp(CE, 1);
                }
                vadjAL(p, cnt);
+       } else if (AL) {
+               /*
+                * Use insert line.
+                */
+               vgoto(p, 0), vputp(AL, WECHO + 1 - p);
+               for (i = cnt - 1; i > 0; i--) {
+                       vgoto(outline+1, 0), vputp(AL, WECHO + 1 - outline);
+                       if ((hold & HOLDAT) == 0)
+                               putchar('@');
+               }
+               vadjAL(p, cnt);
        } else
                could = 0;
        vopenup(cnt, could, l);
        } else
                could = 0;
        vopenup(cnt, could, l);
index 6c60d65..239e403 100644 (file)
@@ -1,4 +1,4 @@
-/*  sccs id  @(#)ex_vars.h     5.1 %G% */
+/*  sccs id  @(#)ex_vars.h     6.1 %G% */
 #define AUTOINDENT      0
 #define AUTOPRINT       1
 #define AUTOWRITE       2
 #define AUTOINDENT      0
 #define AUTOPRINT       1
 #define AUTOWRITE       2
index dc2323b..7ef7a3b 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_vget.c   5.1 %G%";
+static char *sccsid = "@(#)ex_vget.c   6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -251,7 +251,7 @@ readecho(c)
                vglobp = INS;
        }
        OP = Pline; Pline = normline;
                vglobp = INS;
        }
        OP = Pline; Pline = normline;
-       ignore(vgetline(0, genbuf + 1, &waste));
+       ignore(vgetline(0, genbuf + 1, &waste, c));
        if (Outchar == termchar)
                putchar('\n');
        vscrap();
        if (Outchar == termchar)
                putchar('\n');
        vscrap();
index baa25cf..959037c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* sccs id:    @(#)ex_vis.h    5.1 %G%  */
+/* sccs id:    @(#)ex_vis.h    6.1 %G%  */
 /*
  * Ex version 3
  * Mark Horton, UCB
 /*
  * Ex version 3
  * Mark Horton, UCB
index 81beaae..96144f0 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_vmain.c  5.3 %G%";
+static char *sccsid = "@(#)ex_vmain.c  6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -61,6 +61,7 @@ vmain()
                vglobp = 0;
                vreg = 0;
                hold = 0;
                vglobp = 0;
                vreg = 0;
                hold = 0;
+               seenprompt = 1;
                wcursor = 0;
                Xhadcnt = hadcnt = 0;
                Xcnt = cnt = 1;
                wcursor = 0;
                Xhadcnt = hadcnt = 0;
                Xcnt = cnt = 1;
@@ -146,8 +147,10 @@ reread:
                                ungetkey(c);
                                goto looptop;
                        }
                                ungetkey(c);
                                goto looptop;
                        }
-                       if (!value(REMAP))
+                       if (!value(REMAP)) {
+                               c = op;
                                break;
                                break;
+                       }
                        if (++maphopcnt > 256)
                                error("Infinite macro loop");
                } while (c != op);
                        if (++maphopcnt > 256)
                                error("Infinite macro loop");
                } while (c != op);
@@ -389,7 +392,9 @@ reread:
                case CTRL(f):
                        vsave();
                        if (vcnt > 2) {
                case CTRL(f):
                        vsave();
                        if (vcnt > 2) {
-                               dot += (vcnt - vcline) - 2 + (cnt-1)*basWLINES;
+                               addr = dot + (vcnt - vcline) - 2 + (cnt-1)*basWLINES;
+                               forbid(addr > dol);
+                               dot = addr;
                                vcnt = vcline = 0;
                        }
                        vzop(0, 0, '+');
                                vcnt = vcline = 0;
                        }
                        vzop(0, 0, '+');
@@ -402,7 +407,9 @@ reread:
                case CTRL(b):
                        vsave();
                        if (one + vcline != dot && vcnt > 2) {
                case CTRL(b):
                        vsave();
                        if (one + vcline != dot && vcnt > 2) {
-                               dot -= vcline - 2 + (cnt-1)*basWLINES;
+                               addr = dot - vcline - 2 + (cnt-1)*basWLINES;
+                               forbid (addr <= zero);
+                               dot = addr;
                                vcnt = vcline = 0;
                        }
                        vzop(0, 0, '^');
                                vcnt = vcline = 0;
                        }
                        vzop(0, 0, '^');
@@ -490,8 +497,8 @@ reread:
                 */
                case 'O':
                case 'o':
                 */
                case 'O':
                case 'o':
-                       voOpen(c, cnt);
                        vmacchng(1);
                        vmacchng(1);
+                       voOpen(c, cnt);
                        continue;
 
                /*
                        continue;
 
                /*
@@ -852,7 +859,8 @@ gogo:
 #ifdef SIGTSTP
                /*
                 * ^Z:  suspend editor session and temporarily return
 #ifdef SIGTSTP
                /*
                 * ^Z:  suspend editor session and temporarily return
-                *      to shell.  Only works on Berkeley tty driver.
+                *      to shell.  Only works with Berkeley/IIASA process
+                *      control in kernel.
                 */
                case CTRL(z):
                        forbid(dosusp == 0 || !ldisc);
                 */
                case CTRL(z):
                        forbid(dosusp == 0 || !ldisc);
index d9e1da8..d6f0556 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_voper.c  5.1 %G%";
+static char *sccsid = "@(#)ex_voper.c  6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -106,8 +106,8 @@ operate(c, cnt)
         *              character.
         */
        case 'r':
         *              character.
         */
        case 'r':
-               vrep(cnt);
                vmacchng(1);
                vmacchng(1);
+               vrep(cnt);
                return;
 
        default:
                return;
 
        default:
index 64e1a5d..ea62f31 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_vops.c   5.1 %G%";
+static char *sccsid = "@(#)ex_vops.c   6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -173,6 +173,7 @@ bool fromvis;
 {
        line *savedot, *savedol;
        char *savecursor;
 {
        line *savedot, *savedol;
        char *savecursor;
+       char savelb[LBSIZE];
        int nlines, more;
        register line *a1, *a2;
        char ch;        /* DEBUG */
        int nlines, more;
        register line *a1, *a2;
        char ch;        /* DEBUG */
@@ -202,6 +203,7 @@ bool fromvis;
                vudump("before vmacchng hairy case");
 #endif
                savedot = dot; savedol = dol; savecursor = cursor;
                vudump("before vmacchng hairy case");
 #endif
                savedot = dot; savedol = dol; savecursor = cursor;
+               CP(savelb, linebuf);
                nlines = dol - zero;
                while ((line *) endcore - truedol < nlines)
                        morelines();
                nlines = dol - zero;
                while ((line *) endcore - truedol < nlines)
                        morelines();
@@ -228,11 +230,12 @@ bool fromvis;
                more = savedol - dol; /* amount we shift everything by */
                if (more)
                        (*(more>0 ? copywR : copyw))(savedol+1, dol+1, truedol-dol);
                more = savedol - dol; /* amount we shift everything by */
                if (more)
                        (*(more>0 ? copywR : copyw))(savedol+1, dol+1, truedol-dol);
-               unddol += more; truedol += more;
+               unddol += more; truedol += more; undap2 += more;
 
                truedol -= nlines;
                copyw(zero+1, truedol+1, nlines);
                dot = savedot; dol = savedol ; cursor = savecursor;
 
                truedol -= nlines;
                copyw(zero+1, truedol+1, nlines);
                dot = savedot; dol = savedol ; cursor = savecursor;
+               CP(linebuf, savelb);
                vch_mac = VC_MANYCHANGE;
 
                /* Arrange that no further undo saving happens within macro */
                vch_mac = VC_MANYCHANGE;
 
                /* Arrange that no further undo saving happens within macro */
index a83a65f..575b5a9 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_vops2.c  5.1 %G%";
+static char *sccsid = "@(#)ex_vops2.c  6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
@@ -110,7 +110,7 @@ vappend(ch, cnt, indent)
        register int i;
        register char *gcursor;
        bool escape;
        register int i;
        register char *gcursor;
        bool escape;
-       int repcnt;
+       int repcnt, savedoomed;
        short oldhold = hold;
 
        /*
        short oldhold = hold;
 
        /*
@@ -212,7 +212,7 @@ vappend(ch, cnt, indent)
                if (ch == 'r' && repcnt == 0)
                        escape = 0;
                else {
                if (ch == 'r' && repcnt == 0)
                        escape = 0;
                else {
-                       gcursor = vgetline(repcnt, gcursor, &escape);
+                       gcursor = vgetline(repcnt, gcursor, &escape, ch);
 
                        /*
                         * After an append, stick information
 
                        /*
                         * After an append, stick information
@@ -277,6 +277,7 @@ vappend(ch, cnt, indent)
                 */
                if (state != HARDOPEN) {
                        DEPTH(vcline) = 0;
                 */
                if (state != HARDOPEN) {
                        DEPTH(vcline) = 0;
+                       savedoomed = doomed;
                        if (doomed > 0) {
                                register int cind = cindent();
 
                        if (doomed > 0) {
                                register int cind = cindent();
 
@@ -284,6 +285,7 @@ vappend(ch, cnt, indent)
                                doomed = 0;
                        }
                        i = vreopen(LINE(vcline), lineDOT(), vcline);
                                doomed = 0;
                        }
                        i = vreopen(LINE(vcline), lineDOT(), vcline);
+                       doomed = savedoomed;
                }
 
                /*
                }
 
                /*
@@ -396,17 +398,19 @@ back1()
  * are careful about the way we do this so that it is
  * repeatable.  (I.e. so that your kill doesn't happen,
  * when you repeat an insert if it was escaped with \ the
  * are careful about the way we do this so that it is
  * repeatable.  (I.e. so that your kill doesn't happen,
  * when you repeat an insert if it was escaped with \ the
- * first time you did it.
+ * first time you did it.  commch is the command character
+ * involved, including the prompt for readline.
  */
 char *
  */
 char *
-vgetline(cnt, gcursor, aescaped)
+vgetline(cnt, gcursor, aescaped, commch)
        int cnt;
        register char *gcursor;
        bool *aescaped;
        int cnt;
        register char *gcursor;
        bool *aescaped;
+       char commch;
 {
        register int c, ch;
        register char *cp;
 {
        register int c, ch;
        register char *cp;
-       int x, y, iwhite;
+       int x, y, iwhite, backsl=0;
        char *iglobp;
        char cstr[2];
        int (*OO)() = Outchar;
        char *iglobp;
        char cstr[2];
        int (*OO)() = Outchar;
@@ -437,6 +441,7 @@ vgetline(cnt, gcursor, aescaped)
                vprepins();
        }
        for (;;) {
                vprepins();
        }
        for (;;) {
+               backsl = 0;
                if (gobblebl)
                        gobblebl--;
                if (cnt != 0) {
                if (gobblebl)
                        gobblebl--;
                if (cnt != 0) {
@@ -449,7 +454,7 @@ vgetline(cnt, gcursor, aescaped)
                        c &= (QUOTE|TRIM);
                ch = c;
                maphopcnt = 0;
                        c &= (QUOTE|TRIM);
                ch = c;
                maphopcnt = 0;
-               if (vglobp == 0 && Peekkey == 0)
+               if (vglobp == 0 && Peekkey == 0 && commch != 'r')
                        while ((ch = map(c, immacs)) != c) {
                                c = ch;
                                if (!value(REMAP))
                        while ((ch = map(c, immacs)) != c) {
                                c = ch;
                                if (!value(REMAP))
@@ -560,18 +565,20 @@ vbackup:
                                vcsync();
                                c = getkey();
 #ifndef USG3TTY
                                vcsync();
                                c = getkey();
 #ifndef USG3TTY
-                               if (c == tty.sg_erase || c == tty.sg_kill) {
+                               if (c == tty.sg_erase || c == tty.sg_kill)
 #else
                                if (c == tty.c_cc[VERASE]
 #else
                                if (c == tty.c_cc[VERASE]
-                                   || c == tty.c_cc[VKILL]) {
+                                   || c == tty.c_cc[VKILL])
 #endif
 #endif
+                               {
                                        vgoto(y, x);
                                        if (doomed >= 0)
                                                doomed++;
                                        goto def;
                                }
                                ungetkey(c), c = '\\';
                                        vgoto(y, x);
                                        if (doomed >= 0)
                                                doomed++;
                                        goto def;
                                }
                                ungetkey(c), c = '\\';
-                               goto noput;
+                               backsl = 1;
+                               break;
 
                        /*
                         * ^Q           Super quote following character
 
                        /*
                         * ^Q           Super quote following character
@@ -609,21 +616,25 @@ vbackup:
                                gobbled = 1;
                                continue;
                        }
                                gobbled = 1;
                                continue;
                        }
-                       if (/* c <= ' ' && */ value(WRAPMARGIN) &&
-                               outcol >= OCOLUMNS - value(WRAPMARGIN)) {
+                       if (value(WRAPMARGIN) &&
+                               (outcol >= OCOLUMNS - value(WRAPMARGIN) ||
+                                backsl && outcol==0) &&
+                               commch != 'r') {
                                /*
                                 * At end of word and hit wrapmargin.
                                 * Move the word to next line and keep going.
                                 */
                                wdkind = 1;
                                *gcursor++ = c;
                                /*
                                 * At end of word and hit wrapmargin.
                                 * Move the word to next line and keep going.
                                 */
                                wdkind = 1;
                                *gcursor++ = c;
+                               if (backsl)
+                                       *gcursor++ = getkey();
                                *gcursor = 0;
                                /*
                                 * Find end of previous word if we are past it.
                                 */
                                for (cp=gcursor; cp>ogcursor && isspace(cp[-1]); cp--)
                                        ;
                                *gcursor = 0;
                                /*
                                 * Find end of previous word if we are past it.
                                 */
                                for (cp=gcursor; cp>ogcursor && isspace(cp[-1]); cp--)
                                        ;
-                               if (outcol - (gcursor-cp) >= OCOLUMNS - value(WRAPMARGIN)) {
+                               if (outcol+(backsl?OCOLUMNS:0) - (gcursor-cp) >= OCOLUMNS - value(WRAPMARGIN)) {
                                        /*
                                         * Find beginning of previous word.
                                         */
                                        /*
                                         * Find beginning of previous word.
                                         */
@@ -790,9 +801,10 @@ vbackup:
                                continue;
                        }
 def:
                                continue;
                        }
 def:
-                       putchar(c);
-                       flush();
-noput:
+                       if (!backsl) {
+                               putchar(c);
+                               flush();
+                       }
                        if (gcursor > &genbuf[LBSIZE - 2])
                                error("Line too long");
                        *gcursor++ = c & TRIM;
                        if (gcursor > &genbuf[LBSIZE - 2])
                                error("Line too long");
                        *gcursor++ = c & TRIM;
index df56b95..1f2e366 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_vops3.c  5.1 %G%";
+static char *sccsid = "@(#)ex_vops3.c  6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index 8b90f6e..914a467 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_vwind.c  5.1 %G%";
+static char *sccsid = "@(#)ex_vwind.c  6.1 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index 57dbf9f..46238ce 100644 (file)
@@ -15,7 +15,7 @@ ex - /tmp/foo.c <<'X'
        set sh=/bin/csh
        " delete junk (all but data lines)
        g/^[    ]*$/d
        set sh=/bin/csh
        " delete junk (all but data lines)
        g/^[    ]*$/d
-       1,/options/d
+       1,/option options/d
        /}/-1,$d
        " get rid of all of line but option name
        1,$s/   "//
        /}/-1,$d
        " get rid of all of line but option name
        1,$s/   "//
@@ -37,7 +37,7 @@ ex - /tmp/foo.c <<'X'
 .
        $s/e[   ].*[    ]/e     NOPTS   /
        0a
 .
        $s/e[   ].*[    ]/e     NOPTS   /
        0a
-       /*  sccs id   @(#)  ex_vars.h  @(#)makeoptions  5.1 %G%  */
+       /*  sccs id   @(#)  ex_vars.h  @(#)makeoptions  6.1 %G%  */
 .
        w! ex_vars.h
        q
 .
        w! ex_vars.h
        q
index 4e0a76f..d14ad0d 100644 (file)
@@ -1,7 +1,7 @@
 /* The pwb version this is based on */
 static char *printf_id = "@(#) printf.c:2.2 6/5/79";
 /* The local sccs version within ex */
 /* The pwb version this is based on */
 static char *printf_id = "@(#) printf.c:2.2 6/5/79";
 /* The local sccs version within ex */
-static char *sccsid = "@(#)printf.c    5.1 %G%";
+static char *sccsid = "@(#)printf.c    6.1 %G%";
 #include "varargs.h"
 /*
  * This version of printf is compatible with the Version 7 C
 #include "varargs.h"
 /*
  * This version of printf is compatible with the Version 7 C