X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_newterm.c;h=3620a3fdbf2be7fca28b529e34a414a830328da2;hp=05cd9b8a5b00aaa5cb424ae432b834251279f374;hb=396a05943b7da5039dd15d79c4385c7d2a75d6d4;hpb=7a27c7d49c2e8b4a1ecbe85b4423d647cbc75ea5 diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c index 05cd9b8a..3620a3fd 100644 --- a/ncurses/base/lib_newterm.c +++ b/ncurses/base/lib_newterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,7 +48,7 @@ #include /* clear_screen, cup & friends, cur_term */ #include -MODULE_ID("$Id: lib_newterm.c,v 1.67 2007/04/21 20:47:32 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.69 2008/04/12 18:15:04 tom Exp $") #ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */ #define ONLCR 0 @@ -123,17 +123,17 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp) { int value; int errret; - int slk_format = _nc_slk_format; SCREEN *current; SCREEN *result = 0; START_TRACE(); T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp)); + _nc_lock_global(set_SP); /* this loads the capability entry, then sets LINES and COLS */ - if (setupterm(name, fileno(ofp), &errret) == ERR) { - result = 0; - } else { + if (setupterm(name, fileno(ofp), &errret) != ERR) { + int slk_format = _nc_globals.slk_format; + /* * This actually allocates the screen structure, and saves the original * terminal settings. @@ -143,11 +143,7 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp) /* allow user to set maximum escape delay from the environment */ if ((value = _nc_getenv_num("ESCDELAY")) >= 0) { -#if USE_REENTRANT - SP->_ESCDELAY = value; -#else - ESCDELAY = value; -#endif + set_escdelay(value); } if (_nc_setupscreen(LINES, @@ -216,5 +212,6 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp) result = SP; } } + _nc_unlock_global(set_SP); returnSP(result); }