date and time created 85/05/31 12:51:02 by bloom
[unix-history] / usr / src / usr.bin / ex / ex_subr.c
index ade400f..91fbbaf 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1981 Regents of the University of California */
 /* Copyright (c) 1981 Regents of the University of California */
-static char *sccsid = "@(#)ex_subr.c   7.1     %G%";
+static char *sccsid = "@(#)ex_subr.c   5.1.1.1 %G%";
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
@@ -352,7 +352,7 @@ merror(seekpt, i)
        merror1(seekpt);
        if (*cp == '\n')
                putnl(), cp++;
        merror1(seekpt);
        if (*cp == '\n')
                putnl(), cp++;
-       if (inopen && CE)
+       if (inopen > 0 && CE)
                vclreol();
        if (SO && SE)
                putpad(SO);
                vclreol();
        if (SO && SE)
                putpad(SO);
@@ -619,61 +619,6 @@ smerror(seekpt, cp)
                putpad(SE);
 }
 
                putpad(SE);
 }
 
-#define        std_nerrs (sizeof std_errlist / sizeof std_errlist[0])
-
-#define        error(i)        i
-
-#ifdef lint
-char   *std_errlist[] = {
-#else
-# ifdef VMUNIX
-char   *std_errlist[] = {
-# else
-short  std_errlist[] = {
-# endif
-#endif
-       error("Error 0"),
-       error("Not super-user"),
-       error("No such file or directory"),
-       error("No such process"),
-       error("Interrupted system call"),
-       error("Physical I/O error"),
-       error("No such device or address"),
-       error("Argument list too long"),
-       error("Exec format error"),
-       error("Bad file number"),
-       error("No children"),
-       error("No more processes"),
-       error("Not enough core"),
-       error("Permission denied"),
-       error("Bad address"),
-       error("Block device required"),
-       error("Mount device busy"),
-       error("File exists"),
-       error("Cross-device link"),
-       error("No such device"),
-       error("Not a directory"),
-       error("Is a directory"),
-       error("Invalid argument"),
-       error("File table overflow"),
-       error("Too many open files"),
-       error("Not a typewriter"),
-       error("Text file busy"),
-       error("File too large"),
-       error("No space left on device"),
-       error("Illegal seek"),
-       error("Read-only file system"),
-       error("Too many links"),
-       error("Broken pipe"),
-#ifndef V6
-       error("Math argument"),
-       error("Result too large"),
-#endif
-       error("Quota exceeded")         /* Berkeley quota systems only */
-};
-
-#undef error
-
 char *
 strend(cp)
        register char *cp;
 char *
 strend(cp)
        register char *cp;
@@ -694,12 +639,13 @@ strcLIN(dp)
 syserror()
 {
        register int e = errno;
 syserror()
 {
        register int e = errno;
+       extern int sys_nerr;
+       extern char *sys_errlist[];
 
        dirtcnt = 0;
        putchar(' ');
 
        dirtcnt = 0;
        putchar(' ');
-       edited = 0;     /* for temp file errors, for example */
-       if (e >= 0 && errno <= std_nerrs)
-               error(std_errlist[e]);
+       if (e >= 0 && e <= sys_nerr)
+               error(sys_errlist[e]);
        else
                error("System error %d", e);
 }
        else
                error("System error %d", e);
 }
@@ -952,12 +898,15 @@ exit(i)
 onsusp()
 {
        ttymode f;
 onsusp()
 {
        ttymode f;
+       int omask;
+       struct winsize win;
 
        f = setty(normf);
        vnfl();
        putpad(TE);
        flush();
 
 
        f = setty(normf);
        vnfl();
        putpad(TE);
        flush();
 
+       (void) sigsetmask(0);
        signal(SIGTSTP, SIG_DFL);
        kill(0, SIGTSTP);
 
        signal(SIGTSTP, SIG_DFL);
        kill(0, SIGTSTP);
 
@@ -969,6 +918,10 @@ onsusp()
        if (!inopen)
                error(0);
        else {
        if (!inopen)
                error(0);
        else {
+               if (ioctl(0, TIOCGWINSZ, &win) >= 0)
+                       if (win.ws_row != winsz.ws_row ||
+                           win.ws_col != winsz.ws_col)
+                               winch();
                if (vcnt < 0) {
                        vcnt = -vcnt;
                        if (state == VISUAL)
                if (vcnt < 0) {
                        vcnt = -vcnt;
                        if (state == VISUAL)
@@ -980,3 +933,4 @@ onsusp()
                vrepaint(cursor);
        }
 }
                vrepaint(cursor);
        }
 }
+#endif