* main.c (OS_Setup) [!HAVE_X]: Exit immediately if TERM

environment variable is unset or empty.
This commit is contained in:
Pavel Roskin 2001-05-27 15:33:46 +00:00
parent 926aa5ac6b
commit af11550b22
2 changed files with 9 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2001-05-27 Pavel Roskin <proski@gnu.org>
* main.c (OS_Setup) [!HAVE_X]: Exit immediately if TERM
environment variable is unset or empty.
2001-05-25 Pavel Roskin <proski@gnu.org>
* cmd.c: Clean up useless preprocessor directives.

View File

@ -2368,17 +2368,15 @@ char control_file [sizeof (CONTROL_FILE) + 8];
static void
OS_Setup ()
{
char *termvalue;
char *mc_libdir;
#ifndef HAVE_X
char *termvalue;
termvalue = getenv ("TERM");
if (!termvalue){
#ifndef HAVE_X
if (!termvalue || !(*termvalue)){
fprintf (stderr, _("The TERM environment variable is unset!\n"));
#endif
termvalue = "";
exit (1);
}
#ifndef HAVE_X
if (force_xterm || (strncmp (termvalue, "xterm", 5) == 0 || strcmp (termvalue, "dtterm") == 0)){
use_mouse_p = XTERM_MOUSE;
xterm_flag = 1;