mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
* 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.
This commit is contained in:
parent
624c3eb71d
commit
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>
|
||||
|
||||
* 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;
|
||||
|
||||
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);
|
||||
/* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
|
||||
SLang_init_tty (XCTRL('c'), 1, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user