* slint.c (getch): Return -1, not SLANG_GETKEY_ERROR, otherwise

get_key_code() crashes when calling isalpha().
This commit is contained in:
Pavel Roskin 2002-11-28 21:35:49 +00:00
parent e9067abfaf
commit 935b5f8bc7
3 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,8 @@
2002-11-28 Pavel Roskin <proski@gnu.org>
* slint.c (getch): Return -1, not SLANG_GETKEY_ERROR, otherwise
get_key_code() crashes when calling isalpha().
* color.c (mc_init_pair) [HAVE_SLANG]: Pass "default", not NULL
to SLtt_set_color() - it fixes transparency with the latest
versions of S-Lang. Treat foreground like background.

View File

@ -1,8 +1,6 @@
Before 4.6.0-pre2
=================
Crash in isalpha() in key.c is c=0xFFFF.
get_byte() in view.c produces warnings in Valgrind.
Don't allow stdout and stderr from extfs scripts pollute the screen.

View File

@ -493,7 +493,8 @@ load_terminfo_keys (void)
do_define_key (key_table [i].key_code, key_table [i].key_name);
}
int getch (void)
int
getch (void)
{
int c;
if (no_slang_delay)
@ -502,11 +503,13 @@ int getch (void)
c = SLang_getkey2 ();
if (c == SLANG_GETKEY_ERROR) {
fprintf (stderr, "SLang_getkey returned SLANG_GETKEY_ERROR\n"
"Assuming EOF on stdin and exiting\n");
fprintf (stderr,
"SLang_getkey returned SLANG_GETKEY_ERROR\n"
"Assuming EOF on stdin and exiting\n");
quiet_quit_cmd ();
return -1;
}
return (c);
return c;
}
#else