]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/lib_setup.c
ncurses 6.0 - patch 20160213
[ncurses.git] / ncurses / tinfo / lib_setup.c
index 0b81a5e06de3860b7228524c46a0d20c6928fa33..17ec403d5f3213964bb307566d39698864c2663f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2015,2016 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 <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.161 2014/11/01 12:33:16 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.165 2016/02/13 21:20:05 tom Exp $")
 
 /****************************************************************************
  *
@@ -578,6 +578,7 @@ _nc_locale_breaks_acs(TERMINAL * termp)
     int value;
     int result = 0;
 
+    T((T_CALLED("_nc_locale_breaks_acs:%d"), result));
     if (getenv(env_name) != 0) {
        result = _nc_getenv_num(env_name);
     } else if ((value = tigetnum("U8")) >= 0) {
@@ -597,7 +598,7 @@ _nc_locale_breaks_acs(TERMINAL * termp)
            }
        }
     }
-    return result;
+    returnCode(result);
 }
 
 NCURSES_EXPORT(int)
@@ -705,7 +706,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp,
            termp->Filedes = (short) Filedes;
            termp->_termname = strdup(tname);
        } else {
-           ret_error0(TGETENT_ERR,
+           ret_error0(errret ? *errret : TGETENT_ERR,
                       "Could not find any driver to handle this terminal.\n");
        }
 #else
@@ -807,29 +808,27 @@ TINFO_SETUP_TERM(TERMINAL ** tp,
 NCURSES_EXPORT(SCREEN *)
 new_prescr(void)
 {
-    static SCREEN *sp;
+    SCREEN *sp;
 
     START_TRACE();
     T((T_CALLED("new_prescr()")));
 
-    if (sp == 0) {
-       sp = _nc_alloc_screen_sp();
-       if (sp != 0) {
-           sp->rsp = sp->rippedoff;
-           sp->_filtered = _nc_prescreen.filter_mode;
-           sp->_use_env = _nc_prescreen.use_env;
+    sp = _nc_alloc_screen_sp();
+    if (sp != 0) {
+       sp->rsp = sp->rippedoff;
+       sp->_filtered = _nc_prescreen.filter_mode;
+       sp->_use_env = _nc_prescreen.use_env;
 #if NCURSES_NO_PADDING
-           sp->_no_padding = _nc_prescreen._no_padding;
+       sp->_no_padding = _nc_prescreen._no_padding;
 #endif
-           sp->slk_format = 0;
-           sp->_slk = 0;
-           sp->_prescreen = TRUE;
-           SP_PRE_INIT(sp);
+       sp->slk_format = 0;
+       sp->_slk = 0;
+       sp->_prescreen = TRUE;
+       SP_PRE_INIT(sp);
 #if USE_REENTRANT
-           sp->_TABSIZE = _nc_prescreen._TABSIZE;
-           sp->_ESCDELAY = _nc_prescreen._ESCDELAY;
+       sp->_TABSIZE = _nc_prescreen._TABSIZE;
+       sp->_ESCDELAY = _nc_prescreen._ESCDELAY;
 #endif
-       }
     }
     returnSP(sp);
 }
@@ -864,5 +863,6 @@ _nc_setupterm(NCURSES_CONST char *tname,
 NCURSES_EXPORT(int)
 setupterm(NCURSES_CONST char *tname, int Filedes, int *errret)
 {
+    START_TRACE();
     return _nc_setupterm(tname, Filedes, errret, FALSE);
 }