* slint.c (slang_init): Check screen dimensions and exit if they
are abnormal. This may happen due to a S-Lang bug when the TERM is set to a value not listed in termcap or terminfo.
Этот коммит содержится в:
родитель
624c3eb71d
Коммит
c603d50193
@ -1,3 +1,9 @@
|
|||||||
|
2001-06-13 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* slint.c (slang_init): Check screen dimensions and exit if they
|
||||||
|
are abnormal. This may happen due to a S-Lang bug when the TERM
|
||||||
|
is set to a value not listed in termcap or terminfo.
|
||||||
|
|
||||||
2001-06-12 Pavel Roskin <proski@gnu.org>
|
2001-06-12 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* boxes.c [HAVE_CHARSET]: Localize more strings. Lay out the
|
* boxes.c [HAVE_CHARSET]: Localize more strings. Lay out the
|
||||||
|
16
src/slint.c
16
src/slint.c
@ -186,6 +186,22 @@ slang_init (void)
|
|||||||
struct sigaction act, oact;
|
struct sigaction act, oact;
|
||||||
|
|
||||||
SLtt_get_terminfo ();
|
SLtt_get_terminfo ();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the terminal in not in terminfo but begins with a well-known
|
||||||
|
* string such as "linux" or "xterm" S-Lang will go on, but the
|
||||||
|
* terminal size and several other variables won't be initialized
|
||||||
|
* (as of S-Lang 1.4.4). Detect it and abort. Also detect extremely
|
||||||
|
* small, large and negative screen dimensions.
|
||||||
|
*/
|
||||||
|
if ((COLS < 10) || (LINES < 5) || (COLS > 1024) || (LINES > 1024)) {
|
||||||
|
fprintf (stderr,
|
||||||
|
_("Screen size %dx%d is not supported.\n"
|
||||||
|
"Check the TERM environment variable.\n"),
|
||||||
|
COLS, LINES);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
tcgetattr (fileno (stdin), &boot_mode);
|
tcgetattr (fileno (stdin), &boot_mode);
|
||||||
/* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
|
/* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
|
||||||
SLang_init_tty (XCTRL('c'), 1, 0);
|
SLang_init_tty (XCTRL('c'), 1, 0);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user