X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_setup.c;h=0b104ab9f9262489eea21228f8810c4792bab308;hp=21318eb0685d567ce32b73756bae5974fd567636;hb=1078c0231b8a58fbd2dd56b6e0a81b19d6b07f77;hpb=bd7ef7c2309fd00aa4576168c46f557c622cb9c3 diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 21318eb0..0b104ab9 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -53,7 +53,7 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_setup.c,v 1.106 2008/05/17 21:35:36 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.107 2008/06/07 22:22:58 tom Exp $") /**************************************************************************** * @@ -566,20 +566,19 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) ret_error(status, "'%s': unknown terminal type.\n", tname); } } +#if !USE_REENTRANT + strncpy(ttytype, term_ptr->type.term_names, NAMESIZE - 1); + ttytype[NAMESIZE - 1] = '\0'; +#endif + + term_ptr->Filedes = Filedes; + term_ptr->_termname = strdup(tname); set_curterm(term_ptr); if (command_character && getenv("CC")) do_prototype(); -#if !USE_REENTRANT - strncpy(ttytype, cur_term->type.term_names, NAMESIZE - 1); - ttytype[NAMESIZE - 1] = '\0'; -#endif - - cur_term->Filedes = Filedes; - cur_term->_termname = strdup(tname); - /* * If an application calls setupterm() rather than initscr() or * newterm(), we will not have the def_prog_mode() call in