date and time created 83/05/31 00:19:54 by sam
[unix-history] / usr / src / lib / libcurses / setterm.c
index 390ae86..33f7415 100644 (file)
@@ -1,11 +1,10 @@
 /*
  * Terminal initialization routines.
  *
 /*
  * Terminal initialization routines.
  *
- * %G% (Berkeley) @(#)setterm.c        1.9
+ * %G% (Berkeley) @(#)setterm.c        1.13
  */
 
 # include      "curses.ext"
  */
 
 # include      "curses.ext"
-# include      "cr_ex.h"
 
 static bool    *sflags[]       = {
                        &AM, &BS, &EO, &HZ, &IN, &MI, &MS, &NC, &OS, &UL, &XN
 
 static bool    *sflags[]       = {
                        &AM, &BS, &EO, &HZ, &IN, &MI, &MS, &NC, &OS, &UL, &XN
@@ -13,10 +12,11 @@ static bool *sflags[]       = {
 
 static char    *xPC,
                **sstrs[]       = {
 
 static char    *xPC,
                **sstrs[]       = {
-                       &AL, &BC,  &BT, &CD, &CE, &CL, &CM, &DC, &DL,
-                       &DM, &DO,  &ED, &EI, &HO, &IC, &IM, &IP, &LL,
-                       &MA, &ND, &xPC, &SE, &SF, &SO, &SR, &TA, &TE,
-                       &TI, &UC,  &UE, &UP, &US, &VB, &VS, &VE
+                       &AL, &BC, &BT, &CD,  &CE, &CL, &CM, &CR, &DC,
+                       &DL, &DM, &DO, &ED,  &EI, &HO, &IC, &IM, &IP,
+                       &LL, &MA, &ND, &NL, &xPC, &SE, &SF, &SO, &SR,
+                       &TA, &TE, &TI, &UC,  &UE, &UP, &US, &VB, &VS,
+                       &VE
                },
                *tgoto();
 
                },
                *tgoto();
 
@@ -57,8 +57,8 @@ gettmode() {
 setterm(type)
 reg char       *type; {
 
 setterm(type)
 reg char       *type; {
 
-       reg int unknown;
-       char    genbuf[1024];
+       reg int         unknown;
+       static char     genbuf[1024];
 
 # ifdef DEBUG
        fprintf(outf, "SETTERM(\"%s\")\n", type);
 
 # ifdef DEBUG
        fprintf(outf, "SETTERM(\"%s\")\n", type);
@@ -78,15 +78,12 @@ reg char    *type; {
                LINES = tgetnum("li");
        if (LINES <= 5)
                LINES = 24;
                LINES = tgetnum("li");
        if (LINES <= 5)
                LINES = 24;
-       else if (LINES > 48)
-               LINES = 48;
 
        if (COLS == 0)
                COLS = tgetnum("co");
        if (COLS <= 4)
                COLS = 80;
 
        if (COLS == 0)
                COLS = tgetnum("co");
        if (COLS <= 4)
                COLS = 80;
-       else if (COLS > 1000)
-               COLS = 1000;
+
 # ifdef DEBUG
        fprintf(outf, "SETTERM: LINES = %d, COLS = %d\n", LINES, COLS);
 # endif
 # ifdef DEBUG
        fprintf(outf, "SETTERM: LINES = %d, COLS = %d\n", LINES, COLS);
 # endif
@@ -132,7 +129,7 @@ zap() {
        /*
         * get string values
         */
        /*
         * get string values
         */
-       namp = "albcbtcdceclcmdcdldmdoedeihoicimipllmandpcsesfsosrtatetiucueupusvbvsve";
+       namp = "albcbtcdceclcmcrdcdldmdoedeihoicimipllmandnlpcsesfsosrtatetiucueupusvbvsve";
 # ifdef FULLDEBUG
        fprintf(outf, "ZAP: namp = \"%s\"\n", namp);
 # endif
 # ifdef FULLDEBUG
        fprintf(outf, "ZAP: namp = \"%s\"\n", namp);
 # endif
@@ -146,7 +143,7 @@ zap() {
        } while (*namp);
        SG = tgetnum("sg");
        UG = tgetnum("ug");
        } while (*namp);
        SG = tgetnum("sg");
        UG = tgetnum("ug");
-       if ((SG || !SO) && (!UG && US)) {
+       if ((SG > 0 || !SO) && (UG <= 0 && US)) {
                SO = US;
                SE = UE;
        }
                SO = US;
                SE = UE;
        }