+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)setterm.c 5.2 (Berkeley) %G%";
+#endif not lint
+
/*
* Terminal initialization routines.
*
- * @(#)setterm.c 1.16 (Berkeley) %G%
*/
# include "curses.ext"
static bool *sflags[] = {
&AM, &BS, &DA, &DB, &EO, &HC, &HZ, &IN, &MI,
- &MS, &NC, &NS, &OS, &UL, &XB, &XN, &XT, &XX
+ &MS, &NC, &NS, &OS, &UL, &XB, &XN, &XT, &XS,
+ &XX
};
static char *_PC,
PC = _PC ? _PC[0] : FALSE;
aoftspace = _tspace;
- strcpy(ttytype, longname(genbuf, type));
+ strncpy(ttytype, longname(genbuf, type), sizeof(ttytype) - 1);
+ ttytype[sizeof(ttytype) - 1] = '\0';
if (unknown)
return ERR;
return OK;
#endif
extern char *tgetstr();
- namp = "ambsdadbeohchzinmimsncnsosulxbxnxtxx";
+ namp = "ambsdadbeohchzinmimsncnsosulxbxnxtxsxx";
fp = sflags;
do {
*(*fp++) = tgetflag(namp);
#endif
namp += 2;
} while (*namp);
- if (tgetnum("sg") > 0)
- SO = NULL;
- if (tgetnum("ug") > 0)
- US = NULL;
- if (!SO && US) {
- SO = US;
- SE = UE;
+ if (XS)
+ SO = SE = NULL;
+ else {
+ if (tgetnum("sg") > 0)
+ SO = NULL;
+ if (tgetnum("ug") > 0)
+ US = NULL;
+ if (!SO && US) {
+ SO = US;
+ SE = UE;
+ }
}
}