]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_newterm.c
ncurses 5.6 - patch 20080816
[ncurses.git] / ncurses / base / lib_newterm.c
index 3e6034c271f11bc2b01d656f9effd48e25458dfc..05982b84cee4c9b5cfba85c7b5b2a9f54390ddad 100644 (file)
@@ -48,7 +48,7 @@
 #include <term.h>              /* clear_screen, cup & friends, cur_term */
 #include <tic.h>
 
-MODULE_ID("$Id: lib_newterm.c,v 1.71 2008/06/21 20:55:11 tom Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.73 2008/08/16 21:20:48 Werner.Fink Exp $")
 
 #ifndef ONLCR                  /* Allows compilation under the QNX 4.2 OS */
 #define ONLCR 0
@@ -130,6 +130,7 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
     START_TRACE();
     T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp));
 
+    _nc_init_pthreads();
     _nc_lock_global(curses);
 
     current = SP;
@@ -158,6 +159,7 @@ newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
            _nc_set_screen(current);
            result = 0;
        } else {
+           assert(SP != 0);
            /*
             * In setupterm() we did a set_curterm(), but it was before we set
             * SP.  So the "current" screen's terminal pointer was overwritten