X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=tack%2Finit.c;fp=tack%2Finit.c;h=ee9d70139808f6152068384e1807fbf77502a30f;hp=8a2e44fa3cc5dade99b45ab75de99094d6c6f0f6;hb=a8987e73ec254703634802b4f7ee30d3a485524d;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/tack/init.c b/tack/init.c index 8a2e44fa..ee9d7013 100644 --- a/tack/init.c +++ b/tack/init.c @@ -22,7 +22,7 @@ #include -MODULE_ID("$Id: init.c,v 1.3 2001/06/16 17:54:19 tom Exp $") +MODULE_ID("$Id: init.c,v 1.4 2003/09/20 19:40:57 tom Exp $") #if NCURSES_VERSION_MAJOR >= 5 || NCURSES_VERSION_PATCH >= 981219 #define _nc_get_curterm(p) _nc_get_tty_mode(p) @@ -196,9 +196,17 @@ curses_setup( ncurses starts scanning the termcap file. **/ if ((status = _nc_read_entry(tty_basename, tty_filename, &term)) == 0) { - fprintf(stderr, "Terminal not found: TERM=%s\n", tty_basename); - show_usage(exec_name); - exit(1); + const TERMTYPE *fallback = _nc_fallback(tty_basename); + + if (fallback) { + term = *fallback; + sprintf(tty_filename, "(fallback)%s", tty_basename); + status = 1; + } else { + fprintf(stderr, "Terminal not found: TERM=%s\n", tty_basename); + show_usage(exec_name); + exit(1); + } } if (status == -1) { fprintf(stderr, "Terminfo database is inaccessible\n");