]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.0 - patch 20170617
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 18 Jun 2017 00:37:29 +0000 (00:37 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 18 Jun 2017 00:37:29 +0000 (00:37 +0000)
+ fill in some places where TERMTYPE2 vs TERMTYPE was not used
  (report by Allen Hewes).
+ use ExitTerminfo() internally in error-exits for ncurses' setupterm
  to help with leak checking.
+ use ExitProgram() in error-exit from initscr() to help with leak
  checking.
+ review test-programs, adding checks for cases where the terminal
  cannot be initialized.

24 files changed:
NEWS
VERSION
dist.mk
ncurses/base/lib_initscr.c
ncurses/base/lib_mouse.c
ncurses/base/new_pair.c
ncurses/curses.priv.h
ncurses/tinfo/lib_cur_term.c
ncurses/tinfo/lib_setup.c
ncurses/tinfo/tinfo_driver.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
test/bs.c
test/demo_altkeys.c
test/demo_new_pair.c
test/dots_mvcur.c
test/filter.c
test/foldkeys.c
test/list_keys.c
test/sp_tinfo.c

diff --git a/NEWS b/NEWS
index e158c5396ada524987417e7f27b3eeaf4eb4246a..0c0c33e797d8c6eca6aa71213a31591c029a5807 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2855 2017/06/10 22:10:46 tom Exp $
+-- $Id: NEWS,v 1.2859 2017/06/17 21:53:35 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,16 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20170617
+       + fill in some places where TERMTYPE2 vs TERMTYPE was not used
+         (report by Allen Hewes).
+       + use ExitTerminfo() internally in error-exits for ncurses' setupterm
+         to help with leak checking.
+       + use ExitProgram() in error-exit from initscr() to help with leak
+         checking.
+       + review test-programs, adding checks for cases where the terminal
+         cannot be initialized.
+
 20170610
        + add option "-xp" to picsmap.c, to use init_extended_pair().
        + make simple performance fixes for picsmap.c
 20170610
        + add option "-xp" to picsmap.c, to use init_extended_pair().
        + make simple performance fixes for picsmap.c
diff --git a/VERSION b/VERSION
index 5b6dd1bad6ae513d849f94654868a571a3686883..df0fdb8782cb92fdad7e11357642ce5e1628c064 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:9  6.0     20170610
+5:0:9  6.0     20170617
diff --git a/dist.mk b/dist.mk
index afbaf93e82c6115be3cd4fb0ab35b46be8a18e1b..7d448017704445e5340c3824bac954811b874e2b 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1167 2017/06/10 10:38:18 tom Exp $
+# $Id: dist.mk,v 1.1168 2017/06/17 18:17:23 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 0
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 0
-NCURSES_PATCH = 20170610
+NCURSES_PATCH = 20170617
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index c1851b04b703e56815dbb33ba710cd55af417bc0..e0a5c717da4b6c130dde833d4ca312075870de54 100644 (file)
@@ -45,7 +45,7 @@
 #include <sys/termio.h>                /* needed for ISC */
 #endif
 
 #include <sys/termio.h>                /* needed for ISC */
 #endif
 
-MODULE_ID("$Id: lib_initscr.c,v 1.42 2017/03/28 21:14:01 tom Exp $")
+MODULE_ID("$Id: lib_initscr.c,v 1.43 2017/06/17 18:42:45 tom Exp $")
 
 NCURSES_EXPORT(WINDOW *)
 initscr(void)
 
 NCURSES_EXPORT(WINDOW *)
 initscr(void)
@@ -88,7 +88,7 @@ initscr(void)
 #endif
        if (newterm(name, stdout, stdin) == 0) {
            fprintf(stderr, "Error opening terminal: %s.\n", name);
 #endif
        if (newterm(name, stdout, stdin) == 0) {
            fprintf(stderr, "Error opening terminal: %s.\n", name);
-           exit(EXIT_FAILURE);
+           ExitProgram(EXIT_FAILURE);
        }
 
        /* def_shell_mode - done in newterm/_nc_setupscreen */
        }
 
        /* def_shell_mode - done in newterm/_nc_setupscreen */
index 01c7195b7d8e740d65c86e7e8aaec0896cd5d651..61ec3c8b71160baedc7ff32089da66f12ae686c9 100644 (file)
@@ -84,7 +84,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.174 2017/06/10 23:27:20 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.175 2017/06/17 22:05:15 tom Exp $")
 
 #include <tic.h>
 
 
 #include <tic.h>
 
@@ -602,7 +602,7 @@ initialize_mousetype(SCREEN *sp)
     /* OS/2 VIO */
 #if USE_EMX_MOUSE
     if (!sp->_emxmouse_thread
     /* OS/2 VIO */
 #if USE_EMX_MOUSE
     if (!sp->_emxmouse_thread
-       && strstr(TerminalOf(sp)->type.term_names, "xterm") == 0
+       && strstr(SP_TERMTYPE term_names, "xterm") == 0
        && key_mouse) {
        int handles[2];
 
        && key_mouse) {
        int handles[2];
 
@@ -716,10 +716,10 @@ initialize_mousetype(SCREEN *sp)
     /* we know how to recognize mouse events under "xterm" */
     if (key_mouse != 0) {
        if (!strcmp(key_mouse, xterm_kmous)
     /* we know how to recognize mouse events under "xterm" */
     if (key_mouse != 0) {
        if (!strcmp(key_mouse, xterm_kmous)
-           || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
+           || strstr(SP_TERMTYPE term_names, "xterm") != 0) {
            init_xterm_mouse(sp);
        }
            init_xterm_mouse(sp);
        }
-    } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
+    } else if (strstr(SP_TERMTYPE term_names, "xterm") != 0) {
        if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
            init_xterm_mouse(sp);
     }
        if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
            init_xterm_mouse(sp);
     }
index 851e8f0a4758ceff571d80c6f5d5a80196845aae..8597fc4db20b53cc0bb4a1edbfe56b63634bf956 100644 (file)
@@ -60,7 +60,7 @@
 
 #endif
 
 
 #endif
 
-MODULE_ID("$Id: new_pair.c,v 1.10 2017/03/28 09:14:15 tom Exp $")
+MODULE_ID("$Id: new_pair.c,v 1.11 2017/06/17 18:43:16 tom Exp $")
 
 #if USE_NEW_PAIR
 
 
 #if USE_NEW_PAIR
 
@@ -118,7 +118,7 @@ dumpit(SCREEN *sp, int pair, const char *tag)
 
     if (next_len(sp, 0) != prev_len(sp, 0)) {
        endwin();
 
     if (next_len(sp, 0) != prev_len(sp, 0)) {
        endwin();
-       exit(1);
+       ExitProgram(EXIT_FAILURE);
     }
 }
 #else
     }
 }
 #else
index f6c4879f40c4a92df81c08cc0ac7d13094417bf6..e4f62f6923a3ee5a18d67b4a1bb4064ad6974c2e 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.573 2017/06/02 23:19:52 tom Exp $
+ * $Id: curses.priv.h,v 1.575 2017/06/17 22:21:08 tom Exp $
  *
  *     curses.priv.h
  *
  *
  *     curses.priv.h
  *
@@ -394,6 +394,11 @@ color_t;
 #define TerminalType(tp)     (tp)->type
 #endif
 
 #define TerminalType(tp)     (tp)->type
 #endif
 
+#ifdef CUR
+#undef CUR
+#define CUR TerminalType(cur_term).
+#endif
+
 /*
  * Reduce dependency on cur_term global by using terminfo data from SCREEN's
  * pointer to this data.
 /*
  * Reduce dependency on cur_term global by using terminfo data from SCREEN's
  * pointer to this data.
@@ -402,7 +407,7 @@ color_t;
 #undef CUR
 #endif
 
 #undef CUR
 #endif
 
-#define SP_TERMTYPE TerminalOf(sp)->type.
+#define SP_TERMTYPE TerminalType(TerminalOf(sp)).
 
 #include <term_entry.h>
 
 
 #include <term_entry.h>
 
@@ -1918,6 +1923,14 @@ extern NCURSES_EXPORT(void) _nc_expanded (void);
 #define getcwd(buf,len) getwd(buf)
 #endif
 
 #define getcwd(buf,len) getwd(buf)
 #endif
 
+#define save_ttytype(termp) \
+       if (TerminalType(termp).term_names != 0) { \
+           _nc_STRNCPY(ttytype, \
+                       TerminalType(termp).term_names, \
+                       NAMESIZE - 1); \
+           ttytype[NAMESIZE - 1] = '\0'; \
+       }
+
 /* charable.c */
 #if USE_WIDEC_SUPPORT
 extern NCURSES_EXPORT(bool) _nc_is_charable(wchar_t);
 /* charable.c */
 #if USE_WIDEC_SUPPORT
 extern NCURSES_EXPORT(bool) _nc_is_charable(wchar_t);
@@ -2010,13 +2023,20 @@ extern NCURSES_EXPORT(void)   _nc_tinfo_cmdch(TERMINAL *, int);
 extern NCURSES_EXPORT(int)    _nc_ripoffline(int, int(*)(WINDOW*, int));
 
 /* lib_setup.c */
 extern NCURSES_EXPORT(int)    _nc_ripoffline(int, int(*)(WINDOW*, int));
 
 /* lib_setup.c */
+#if NO_LEAKS
+#define ExitTerminfo(code)    _nc_free_tinfo(code)
+#else
+#define ExitTerminfo(code)    exit(code)
+#endif
+
 #define SETUP_FAIL ERR
 #define SETUP_FAIL ERR
+
 #define ret_error(code, fmt, arg)      if (errret) {\
                                            *errret = code;\
                                            returnCode(SETUP_FAIL);\
                                        } else {\
                                            fprintf(stderr, fmt, arg);\
 #define ret_error(code, fmt, arg)      if (errret) {\
                                            *errret = code;\
                                            returnCode(SETUP_FAIL);\
                                        } else {\
                                            fprintf(stderr, fmt, arg);\
-                                           exit(EXIT_FAILURE);\
+                                           ExitTerminfo(EXIT_FAILURE);\
                                        }
 
 #define ret_error1(code, fmt, arg)     ret_error(code, "'%s': " fmt, arg)
                                        }
 
 #define ret_error1(code, fmt, arg)     ret_error(code, "'%s': " fmt, arg)
@@ -2026,7 +2046,7 @@ extern NCURSES_EXPORT(int)    _nc_ripoffline(int, int(*)(WINDOW*, int));
                                            returnCode(SETUP_FAIL);\
                                        } else {\
                                            fprintf(stderr, msg);\
                                            returnCode(SETUP_FAIL);\
                                        } else {\
                                            fprintf(stderr, msg);\
-                                           exit(EXIT_FAILURE);\
+                                           ExitTerminfo(EXIT_FAILURE);\
                                        }
 
 /* lib_tstp.c */
                                        }
 
 /* lib_tstp.c */
index a61a65561bbf83fb62dc29067636842291b7abdf..e5cd76bf22a5dc095553619414be8e0b27c81cbd 100644 (file)
@@ -39,7 +39,7 @@
 #include <curses.priv.h>
 #include <termcap.h>           /* ospeed */
 
 #include <curses.priv.h>
 #include <termcap.h>           /* ospeed */
 
-MODULE_ID("$Id: lib_cur_term.c,v 1.40 2017/04/15 21:35:08 tom Exp $")
+MODULE_ID("$Id: lib_cur_term.c,v 1.41 2017/06/17 22:21:35 tom Exp $")
 
 #undef CUR
 #define CUR TerminalType(termp).
 
 #undef CUR
 #define CUR TerminalType(termp).
@@ -108,9 +108,7 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL *termp)
        }
 #endif
 #if !USE_REENTRANT
        }
 #endif
 #if !USE_REENTRANT
-#define MY_SIZE (size_t) (NAMESIZE - 1)
-       _nc_STRNCPY(ttytype, TerminalType(termp).term_names, MY_SIZE);
-       ttytype[MY_SIZE] = '\0';
+       save_ttytype(termp);
 #endif
     }
     _nc_unlock_global(curses);
 #endif
     }
     _nc_unlock_global(curses);
index 67a2a0aa828eafcbfd29efc59fd950154ad76ac2..93a42a04a3aabc2f0188f0af5bdfd69c1c1e3cf7 100644 (file)
@@ -48,7 +48,7 @@
 #include <locale.h>
 #endif
 
 #include <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.178 2017/04/11 23:51:32 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.182 2017/06/17 22:21:50 tom Exp $")
 
 /****************************************************************************
  *
 
 /****************************************************************************
  *
@@ -115,12 +115,12 @@ NCURSES_PUBLIC_VAR(ttytype) (void)
     if (CURRENT_SCREEN) {
        TERMINAL *termp = TerminalOf(CURRENT_SCREEN);
        if (termp != 0) {
     if (CURRENT_SCREEN) {
        TERMINAL *termp = TerminalOf(CURRENT_SCREEN);
        if (termp != 0) {
-           result = termp->type.term_names;
+           result = TerminalType(termp).term_names;
        }
     }
 #else
     if (cur_term != 0) {
        }
     }
 #else
     if (cur_term != 0) {
-       result = cur_term->type.term_names;
+       result = TerminalType(cur_term).term_names;
     }
 #endif
     return result;
     }
 #endif
     return result;
@@ -693,7 +693,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
        && termp->Filedes == Filedes
        && termp->_termname != 0
        && !strcmp(termp->_termname, tname)
        && termp->Filedes == Filedes
        && termp->_termname != 0
        && !strcmp(termp->_termname, tname)
-       && _nc_name_match(termp->type.term_names, tname, "|")) {
+       && _nc_name_match(TerminalType(termp).term_names, tname, "|")) {
        T(("reusing existing terminal information and mode-settings"));
        code = OK;
 #ifdef USE_TERM_DRIVER
        T(("reusing existing terminal information and mode-settings"));
        code = OK;
 #ifdef USE_TERM_DRIVER
@@ -721,6 +721,8 @@ TINFO_SETUP_TERM(TERMINAL **tp,
            termp->Filedes = (short) Filedes;
            termp->_termname = strdup(tname);
        } else {
            termp->Filedes = (short) Filedes;
            termp->_termname = strdup(tname);
        } else {
+           _nc_free_termtype2(&TerminalType(termp));
+           free(my_tcb);
            ret_error0(errret ? *errret : TGETENT_ERR,
                       "Could not find any driver to handle this terminal.\n");
        }
            ret_error0(errret ? *errret : TGETENT_ERR,
                       "Could not find any driver to handle this terminal.\n");
        }
@@ -744,8 +746,10 @@ TINFO_SETUP_TERM(TERMINAL **tp,
        if (status != TGETENT_YES) {
            del_curterm(termp);
            if (status == TGETENT_ERR) {
        if (status != TGETENT_YES) {
            del_curterm(termp);
            if (status == TGETENT_ERR) {
+               _nc_free_termtype2(&TerminalType(termp));
                ret_error0(status, "terminals database is inaccessible\n");
            } else if (status == TGETENT_NO) {
                ret_error0(status, "terminals database is inaccessible\n");
            } else if (status == TGETENT_NO) {
+               _nc_free_termtype2(&TerminalType(termp));
                ret_error1(status, "unknown terminal type.\n", tname);
            }
        }
                ret_error1(status, "unknown terminal type.\n", tname);
            }
        }
@@ -753,9 +757,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
        _nc_export_termtype2(&termp->type, &TerminalType(termp));
 #endif
 #if !USE_REENTRANT
        _nc_export_termtype2(&termp->type, &TerminalType(termp));
 #endif
 #if !USE_REENTRANT
-#define MY_SIZE (size_t) (NAMESIZE - 1)
-       _nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE);
-       ttytype[MY_SIZE] = '\0';
+       save_ttytype(termp);
 #endif
 
        termp->Filedes = (short) Filedes;
 #endif
 
        termp->Filedes = (short) Filedes;
index 21004732068a0a2f55b3c1d5fe79ebf371e04591..8d471d184e6ba0d6def6c877965772c001ba5613 100644 (file)
@@ -51,7 +51,7 @@
 # endif
 #endif
 
 # endif
 #endif
 
-MODULE_ID("$Id: tinfo_driver.c,v 1.51 2017/04/14 08:19:49 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.54 2017/06/17 22:22:03 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -179,8 +179,10 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
     if (status != TGETENT_YES) {
        NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx termp);
        if (status == TGETENT_ERR) {
     if (status != TGETENT_YES) {
        NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx termp);
        if (status == TGETENT_ERR) {
+           _nc_free_termtype2(&TerminalType(termp));
            ret_error0(status, "terminals database is inaccessible\n");
        } else if (status == TGETENT_NO) {
            ret_error0(status, "terminals database is inaccessible\n");
        } else if (status == TGETENT_NO) {
+           _nc_free_termtype2(&TerminalType(termp));
            ret_error1(status, "unknown terminal type.\n", tname);
        }
     }
            ret_error1(status, "unknown terminal type.\n", tname);
        }
     }
@@ -189,9 +191,7 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
     _nc_export_termtype2(&termp->type, &TerminalType(termp));
 #endif
 #if !USE_REENTRANT
     _nc_export_termtype2(&termp->type, &TerminalType(termp));
 #endif
 #if !USE_REENTRANT
-#define MY_SIZE (size_t) NAMESIZE - 1
-    _nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE);
-    ttytype[MY_SIZE] = '\0';
+    save_ttytype(termp);
 #endif
 
     if (command_character)
 #endif
 
     if (command_character)
@@ -215,12 +215,15 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
        if ((VALID_STRING(cursor_address)
             || (VALID_STRING(cursor_down) && VALID_STRING(cursor_home)))
            && VALID_STRING(clear_screen)) {
        if ((VALID_STRING(cursor_address)
             || (VALID_STRING(cursor_down) && VALID_STRING(cursor_home)))
            && VALID_STRING(clear_screen)) {
+           _nc_free_termtype2(&TerminalType(termp));
            ret_error1(TGETENT_YES, "terminal is not really generic.\n", tname);
        } else {
            ret_error1(TGETENT_YES, "terminal is not really generic.\n", tname);
        } else {
+           _nc_free_termtype2(&TerminalType(termp));
            ret_error1(TGETENT_NO, "I need something more specific.\n", tname);
        }
     }
     if (hard_copy) {
            ret_error1(TGETENT_NO, "I need something more specific.\n", tname);
        }
     }
     if (hard_copy) {
+       _nc_free_termtype2(&TerminalType(termp));
        ret_error1(TGETENT_YES, "I can't handle hardcopy terminals.\n", tname);
     }
 
        ret_error1(TGETENT_YES, "I can't handle hardcopy terminals.\n", tname);
     }
 
@@ -887,10 +890,10 @@ drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB)
     if (sp != 0) {
        if (key_mouse != 0) {
            if (!strcmp(key_mouse, xterm_kmous)
     if (sp != 0) {
        if (key_mouse != 0) {
            if (!strcmp(key_mouse, xterm_kmous)
-               || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
+               || strstr(SP_TERMTYPE term_names, "xterm") != 0) {
                init_xterm_mouse(sp);
            }
                init_xterm_mouse(sp);
            }
-       } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
+       } else if (strstr(SP_TERMTYPE term_names, "xterm") != 0) {
            if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
                init_xterm_mouse(sp);
        }
            if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
                init_xterm_mouse(sp);
        }
index edceaed7e89be90381dfc1947ab2cce30a06f7a0..1f234fac7987c18483342e4b71df228d068f7422 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170610) unstable; urgency=low
+ncurses6 (6.0+20170617) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Jun 2017 06:38:19 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Jun 2017 14:17:23 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index edceaed7e89be90381dfc1947ab2cce30a06f7a0..1f234fac7987c18483342e4b71df228d068f7422 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170610) unstable; urgency=low
+ncurses6 (6.0+20170617) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Jun 2017 06:38:19 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Jun 2017 14:17:23 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index e62bc966d8c7753e080ab32b5c74bd3dc7bbdddb..aa223f1b34e84d9cae07219cb7557fc9e0697514 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170610) unstable; urgency=low
+ncurses6 (6.0+20170617) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Jun 2017 06:38:19 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Jun 2017 14:17:23 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 151e1898ee8f26d7a6206a15bd57e93ae13cba35..b637b8e48d0d4f8673904d11dc20a045e63d161b 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.215 2017/06/10 10:38:18 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.216 2017/06/17 18:17:23 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "0"\r
 !define VERSION_YYYY  "2017"\r
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "0"\r
 !define VERSION_YYYY  "2017"\r
-!define VERSION_MMDD  "0610"\r
+!define VERSION_MMDD  "0617"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 08db8d9c626ae64bd08faf8dace96a044302567f..be2a22d08c1fe4a27d0ebee83d9021243094f78c 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
-Release: 20170610
+Release: 20170617
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 8a7047891ff5e78d69d3692310d3982cb6c26a97..741ff1f2ea7346014cdd8eadf6cc07cdb93e13d2 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
-Release: 20170610
+Release: 20170617
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 7f2984742c7136073ebf4a23ab017be2290955c1..5959758858e9c7b284806b12140e17a90c3e36e1 100644 (file)
--- a/test/bs.c
+++ b/test/bs.c
@@ -34,7 +34,7 @@
  * v2.0 featuring strict ANSI/POSIX conformance, November 1993.
  * v2.1 with ncurses mouse support, September 1995
  *
  * v2.0 featuring strict ANSI/POSIX conformance, November 1993.
  * v2.1 with ncurses mouse support, September 1995
  *
- * $Id: bs.c,v 1.67 2017/05/14 00:27:05 tom Exp $
+ * $Id: bs.c,v 1.68 2017/06/17 18:45:40 tom Exp $
  */
 
 #include <test.priv.h>
  */
 
 #include <test.priv.h>
@@ -220,6 +220,7 @@ intro(void)
     srand((unsigned) (time(0L) + getpid()));   /* Kick the random number generator */
 
     CATCHALL(uninitgame);
     srand((unsigned) (time(0L) + getpid()));   /* Kick the random number generator */
 
     CATCHALL(uninitgame);
+    (void) initscr();
 
     if ((tmpname = getlogin()) != 0 &&
        (your_name = strdup(tmpname)) != 0) {
 
     if ((tmpname = getlogin()) != 0 &&
        (your_name = strdup(tmpname)) != 0) {
@@ -228,7 +229,6 @@ intro(void)
        your_name = strdup(dftname);
     }
 
        your_name = strdup(dftname);
     }
 
-    (void) initscr();
     keypad(stdscr, TRUE);
     (void) def_prog_mode();
     (void) nonl();
     keypad(stdscr, TRUE);
     (void) def_prog_mode();
     (void) nonl();
index 3dcb780b57346a08dccea580db5fee8b2ae80ef2..a83a549d23b5e19454da0eefed1b8715a8433e2f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 2005-2010,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2005-2016,2017 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_altkeys.c,v 1.10 2016/09/04 20:17:42 tom Exp $
+ * $Id: demo_altkeys.c,v 1.11 2017/06/17 18:33:03 tom Exp $
  *
  * Demonstrate the define_key() function.
  * Thomas Dickey - 2005/10/22
  *
  * Demonstrate the define_key() function.
  * Thomas Dickey - 2005/10/22
@@ -91,7 +91,10 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 
     unlink(MY_LOGFILE);
 
 
     unlink(MY_LOGFILE);
 
-    newterm(0, stdout, stdin);
+    if (newterm(0, stdout, stdin) == 0) {
+       fprintf(stderr, "Cannot initialize terminal\n");
+       ExitProgram(EXIT_FAILURE);
+    }
     (void) cbreak();           /* take input chars one at a time, no wait for \n */
     (void) noecho();           /* don't echo input */
 
     (void) cbreak();           /* take input chars one at a time, no wait for \n */
     (void) noecho();           /* don't echo input */
 
index 1070c06ae2290ad91e5806b8eb0d2ad243cf5cb4..8c29870b81290d25626603f9f44cf5e67ca90afa 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_new_pair.c,v 1.13 2017/04/15 17:36:00 tom Exp $
+ * $Id: demo_new_pair.c,v 1.14 2017/06/17 19:48:45 tom Exp $
  *
  * Demonstrate the alloc_pair() function.
  */
  *
  * Demonstrate the alloc_pair() function.
  */
@@ -229,8 +229,10 @@ main(int argc, char *argv[])
        fprintf(stderr, "cannot open terminal for output\n");
        ExitProgram(EXIT_FAILURE);
     }
        fprintf(stderr, "cannot open terminal for output\n");
        ExitProgram(EXIT_FAILURE);
     }
-    if (newterm(NULL, output, stdin) == 0)
-       usage();
+    if (newterm(NULL, output, stdin) == 0) {
+       fprintf(stderr, "Cannot initialize terminal\n");
+       ExitProgram(EXIT_FAILURE);
+    }
     (void) cbreak();           /* read chars without wait for \n */
     (void) noecho();           /* don't echo input */
     update_modes();
     (void) cbreak();           /* read chars without wait for \n */
     (void) noecho();           /* don't echo input */
     update_modes();
index 90b9c4e5b17b7582ebffc6a823bfe3d396a8cbe7..4812282ecebfdf57949fe6c156cd9e7578d662b9 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 2007-2009,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 2007-2013,2017 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey - 2007
  *
 /*
  * Author: Thomas E. Dickey - 2007
  *
- * $Id: dots_mvcur.c,v 1.10 2013/09/28 22:44:18 tom Exp $
+ * $Id: dots_mvcur.c,v 1.11 2017/06/17 18:25:30 tom Exp $
  *
  * A simple demo of the terminfo interface, and mvcur.
  */
  *
  * A simple demo of the terminfo interface, and mvcur.
  */
@@ -113,7 +113,10 @@ main(int argc GCC_UNUSED,
     CATCHALL(onsig);
 
     srand((unsigned) time(0));
     CATCHALL(onsig);
 
     srand((unsigned) time(0));
-    sp = newterm((char *) 0, stdout, stdin);
+    if ((sp = newterm((char *) 0, stdout, stdin)) == 0) {
+       fprintf(stderr, "Cannot initialize terminal\n");
+       ExitProgram(EXIT_FAILURE);
+    }
     outs(clear_screen);
     outs(cursor_home);
     outs(cursor_invisible);
     outs(clear_screen);
     outs(cursor_home);
     outs(cursor_invisible);
index 90a74a6cec9bc2790ed2cfed70630d1b8c12e587..926ec6b8dcae143c6e864dfbaa7ba4a4a182a26e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2014,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2016,2017 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +29,7 @@
 /*
  * Author:  Thomas E. Dickey 1998
  *
 /*
  * Author:  Thomas E. Dickey 1998
  *
- * $Id: filter.c,v 1.28 2016/09/10 21:23:23 tom Exp $
+ * $Id: filter.c,v 1.29 2017/06/17 18:16:39 tom Exp $
  *
  * An example of the 'filter()' function in ncurses, this program prompts
  * for commands and executes them (like a command shell).  It illustrates
  *
  * An example of the 'filter()' function in ncurses, this program prompts
  * for commands and executes them (like a command shell).  It illustrates
@@ -359,7 +359,10 @@ main(int argc, char *argv[])
     if (i_option) {
        initscr();
     } else {
     if (i_option) {
        initscr();
     } else {
-       (void) newterm((char *) 0, stdout, stdin);
+       if (newterm((char *) 0, stdout, stdin) == 0) {
+           fprintf(stderr, "cannot initialize terminal\n");
+           ExitProgram(EXIT_FAILURE);
+       }
     }
 #ifdef NCURSES_VERSION
     if (a_option) {
     }
 #ifdef NCURSES_VERSION
     if (a_option) {
index 30d4b7df57b14106098e50412a999f6fe7c5fcb4..f7ecfd97b9195c8fb41cd4e303538c7d8556a2d2 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 2006,2016 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2006-2016,2017 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey, 2006
  *
 /*
  * Author: Thomas E. Dickey, 2006
  *
- * $Id: foldkeys.c,v 1.5 2016/09/04 20:49:06 tom Exp $
+ * $Id: foldkeys.c,v 1.6 2017/06/17 19:36:33 tom Exp $
  *
  * Demonstrate a method for altering key definitions at runtime.
  *
  *
  * Demonstrate a method for altering key definitions at runtime.
  *
@@ -209,9 +209,13 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
     struct timeval current, previous;
 #endif
 
     struct timeval current, previous;
 #endif
 
+    if (newterm(0, stdout, stdin) == 0) {
+       fprintf(stderr, "Cannot initialize terminal\n");
+       ExitProgram(EXIT_FAILURE);
+    }
+
     unlink(MY_LOGFILE);
 
     unlink(MY_LOGFILE);
 
-    newterm(0, stdout, stdin);
     (void) cbreak();           /* take input chars one at a time, no wait for \n */
     (void) noecho();           /* don't echo input */
 
     (void) cbreak();           /* take input chars one at a time, no wait for \n */
     (void) noecho();           /* don't echo input */
 
index 31c057a0a7f6ef29c38b2340fc37bdf7b0b11982..00460c2d423def0297219f01d4da3d839e0f4937 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: list_keys.c,v 1.19 2017/04/08 22:57:26 tom Exp $
+ * $Id: list_keys.c,v 1.20 2017/06/17 21:11:25 tom Exp $
  *
  * Author: Thomas E Dickey
  *
  *
  * Author: Thomas E Dickey
  *
@@ -89,7 +89,7 @@ show_key(const char *name, bool show)
 {
     int width = 0;
     char buffer[10];
 {
     int width = 0;
     char buffer[10];
-    NCURSES_CONST char *value = tigetstr(name);
+    NCURSES_CONST char *value = tigetstr((NCURSES_CONST char *) name);
 
     if (show && t_opt)
        fputc('"', stdout);
 
     if (show && t_opt)
        fputc('"', stdout);
index 1c20588a4257d429ae2e8e3a4d4733784eab6fdd..a3e5c55323c49ca3c56fcbc180e7919629bee613 100644 (file)
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /*
  ****************************************************************************/
 
 /*
- * $Id: sp_tinfo.c,v 1.19 2017/05/13 23:19:04 tom Exp $
+ * $Id: sp_tinfo.c,v 1.21 2017/06/17 21:19:25 tom Exp $
  *
  * TOTO: add option for non-sp-funcs interface
  */
  *
  * TOTO: add option for non-sp-funcs interface
  */
@@ -81,7 +81,7 @@ initialize(const char *name, FILE *output)
        tgetent_sp(result->sp, temp, name);
        free(temp);
     } else {
        tgetent_sp(result->sp, temp, name);
        free(temp);
     } else {
-       setupterm(name, fileno(output), &error);
+       setupterm((NCURSES_CONST char *) name, fileno(output), &error);
     }
     result->term = cur_term;
 
     }
     result->term = cur_term;
 
@@ -100,13 +100,16 @@ show_flag(MYDATA * data, const char *name, int value)
     }
 }
 
     }
 }
 
+#define TC_PARMS data->sp, (NCURSES_CONST char *)tc
+#define TI_PARMS data->sp, (NCURSES_CONST char *)ti
+
 static void
 show_cap_flag(MYDATA * data, const char *ti, const char *tc)
 {
     const char *name = (opt_t ? tc : ti);
     show_flag(data, name, (opt_t
 static void
 show_cap_flag(MYDATA * data, const char *ti, const char *tc)
 {
     const char *name = (opt_t ? tc : ti);
     show_flag(data, name, (opt_t
-                          ? tgetflag_sp(data->sp, tc)
-                          : tigetflag_sp(data->sp, ti)));
+                          ? tgetflag_sp(TC_PARMS)
+                          : tigetflag_sp(TI_PARMS)));
 }
 
 static void
 }
 
 static void
@@ -126,8 +129,8 @@ show_cap_number(MYDATA * data, const char *ti, const char *tc)
 {
     const char *name = (opt_t ? tc : ti);
     show_number(data, name, (opt_t
 {
     const char *name = (opt_t ? tc : ti);
     show_number(data, name, (opt_t
-                            ? tgetnum_sp(data->sp, tc)
-                            : tigetnum_sp(data->sp, ti)));
+                            ? tgetnum_sp(TC_PARMS)
+                            : tigetnum_sp(TI_PARMS)));
 }
 
 static void
 }
 
 static void
@@ -162,8 +165,8 @@ show_cap_string(MYDATA * data, const char *ti, const char *tc)
     char tcapjunk[1024];
     char *tcap_ptr = tcapjunk;
     show_string(data, name, (opt_t
     char tcapjunk[1024];
     char *tcap_ptr = tcapjunk;
     show_string(data, name, (opt_t
-                            ? tgetstr_sp(data->sp, tc, &tcap_ptr)
-                            : tigetstr_sp(data->sp, ti)));
+                            ? tgetstr_sp(TC_PARMS, &tcap_ptr)
+                            : tigetstr_sp(TI_PARMS)));
 }
 
 static void
 }
 
 static void