]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.0 - patch 20170408
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Apr 2017 01:34:02 +0000 (01:34 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Apr 2017 01:34:02 +0000 (01:34 +0000)
+ change logic in wins_nwstr() to avoid addressing data past the output
  of mbstowcs().
+ correct a call to setcchar() in Data_Entry_w() from 20131207 changes.
+ fix minor memory-leaks in test-programs.
+ further improve ifdef in term_entry.h for internal definitions not
  used by tack.

34 files changed:
MANIFEST
NEWS
VERSION
dist.mk
form/frm_driver.c
include/MKterm.h.awk.in
include/term_entry.h
ncurses/base/lib_newterm.c
ncurses/base/lib_set_term.c
ncurses/tinfo/lib_setup.c
ncurses/tinfo/lib_ttyflags.c
ncurses/tinfo/parse_entry.c
ncurses/widechar/lib_ins_wch.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_new_pair.c
test/demo_termcap.c
test/demo_terminfo.c
test/echochar.c
test/extended_color.c
test/ins_wide.c
test/inserts.c
test/list_keys.c
test/movewindow.c
test/test_add_wchstr.c
test/test_addchstr.c
test/test_instr.c
test/test_sgr.c
test/worm.c

index bcc0bcf1c72fe54aec65fb641ca2bb5c1226b9f7..a2511d165acc1521f7ffbadd96005fe655fdfe03 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./test/echochar.c
 ./test/edit_field.c
 ./test/edit_field.h
+./test/extended_color.c
 ./test/filter.c
 ./test/firework.c
 ./test/firstlast.c
 ./test/redraw.c
 ./test/savescreen.c
 ./test/savescreen.sh
+./test/sp_tinfo.c
 ./test/tclock.c
 ./test/test.priv.h
 ./test/test_add_wchstr.c
diff --git a/NEWS b/NEWS
index 769aea14fb9e1c74a6c4edb98c906297d8eeb257..acd629940c2b6a541dc07157220ee2ebb11d9733 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2794 2017/04/01 20:42:24 tom Exp $
+-- $Id: NEWS,v 1.2799 2017/04/08 22:54:04 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,14 @@ 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.
 
+20170408
+       + change logic in wins_nwstr() to avoid addressing data past the output
+         of mbstowcs().
+       + correct a call to setcchar() in Data_Entry_w() from 20131207 changes.
+       + fix minor memory-leaks in test-programs.
+       + further improve ifdef in term_entry.h for internal definitions not
+         used by tack.
+
 20170401
        + minor fixes for vt100+4bsd, e.g., delay in sgr for consistency -TD
        + add smso for env230, to match sgr -TD
diff --git a/VERSION b/VERSION
index 5c5013476b98aff2b32076ca7dba859528bf76e1..dd3f3e10413e85d45d1e6a14da7388a60b78be60 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:9  6.0     20170401
+5:0:9  6.0     20170408
diff --git a/dist.mk b/dist.mk
index 9fb361b67fa4fa1d41de66284c36c0513de763d0..95d78c39c46dc5a56f54ea611c86d7220d633438 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1154 2017/03/26 13:39:03 tom Exp $
+# $Id: dist.mk,v 1.1155 2017/04/02 10:36:57 tom Exp $
 # 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
-NCURSES_PATCH = 20170401
+NCURSES_PATCH = 20170408
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 66031d697abb09fbc7986b0c214bd1e9d8051c79..45e323f73b6cab87169e5d6e57a772aba83e2362 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2015,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.120 2016/12/24 22:28:28 Leon.Winter Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.121 2017/04/08 22:02:15 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -4045,7 +4045,7 @@ Data_Entry_w(FORM *form, wchar_t c)
       cchar_t temp_ch;
 
       given[0] = c;
-      given[1] = 1;
+      given[1] = 0;
       setcchar(&temp_ch, given, 0, 0, (void *)0);
       if ((Field_Has_Option(field, O_BLANK)) &&
          First_Position_In_Current_Field(form) &&
index a030c2510fd075395751dbf4596adb346c14085c..3146ee8ded811ba7b993d559e8d4e357885575a4 100644 (file)
 # vile:awkmode
-BEGIN          {
-                   print  "/****************************************************************************"
-                   print  " * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc.              *"
-                   print  " *                                                                          *"
-                   print  " * Permission is hereby granted, free of charge, to any person obtaining a  *"
-                   print  " * copy of this software and associated documentation files (the            *"
-                   print  " * \"Software\"), to deal in the Software without restriction, including      *"
-                   print  " * without limitation the rights to use, copy, modify, merge, publish,      *"
-                   print  " * distribute, distribute with modifications, sublicense, and/or sell       *"
-                   print  " * copies of the Software, and to permit persons to whom the Software is    *"
-                   print  " * furnished to do so, subject to the following conditions:                 *"
-                   print  " *                                                                          *"
-                   print  " * The above copyright notice and this permission notice shall be included  *"
-                   print  " * in all copies or substantial portions of the Software.                   *"
-                   print  " *                                                                          *"
-                   print  " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *"
-                   print  " * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *"
-                   print  " * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *"
-                   print  " * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *"
-                   print  " * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *"
-                   print  " * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *"
-                   print  " * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *"
-                   print  " *                                                                          *"
-                   print  " * Except as contained in this notice, the name(s) of the above copyright   *"
-                   print  " * holders shall not be used in advertising or otherwise to promote the     *"
-                   print  " * sale, use or other dealings in this Software without prior written       *"
-                   print  " * authorization.                                                           *"
-                   print  " ****************************************************************************/"
-                   print  ""
-                   print  "/****************************************************************************/"
-                   print  "/* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995                */"
-                   print  "/*    and: Eric S. Raymond <esr@snark.thyrsus.com>                          */"
-                   print  "/*    and: Thomas E. Dickey                        1995-on                  */"
-                   print  "/****************************************************************************/"
-                   print  ""
-                   print  "/* $Id: MKterm.h.awk.in,v 1.65 2017/03/18 20:05:53 tom Exp $ */"
-                   print  ""
-                   print  "/*"
-                   print  "**  term.h -- Definition of struct term"
-                   print  "*/"
-                   print  ""
-                   print  "#ifndef NCURSES_TERM_H_incl"
-                   print  "#define NCURSES_TERM_H_incl 1"
-                   print  ""
-                   print  "#undef  NCURSES_VERSION"
-                   print  "#define NCURSES_VERSION \"@NCURSES_MAJOR@.@NCURSES_MINOR@\""
-                   print  ""
-                   print  "#include <ncurses_dll.h>"
-                   print  ""
-                   print  "#ifdef __cplusplus"
-                   print  "extern \"C\" {"
-                   print  "#endif"
-                   print  ""
-                   print  "/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H"
-                   print  " * definition (based on the system for which this was configured)."
-                   print  " */"
-                   print  ""
-                   print  "#undef  NCURSES_CONST"
-                   print  "#define NCURSES_CONST @NCURSES_CONST@"
-                   print  ""
-                   print  "#undef  NCURSES_SBOOL"
-                   print  "#define NCURSES_SBOOL @NCURSES_SBOOL@"
-                   print  ""
-                   print  "#undef  NCURSES_USE_DATABASE"
-                   print  "#define NCURSES_USE_DATABASE @NCURSES_USE_DATABASE@"
-                   print  ""
-                   print  "#undef  NCURSES_USE_TERMCAP"
-                   print  "#define NCURSES_USE_TERMCAP @NCURSES_USE_TERMCAP@"
-                   print  ""
-                   print  "#undef  NCURSES_XNAMES"
-                   print  "#define NCURSES_XNAMES @NCURSES_XNAMES@"
-                   print  ""
-                   print  "/* We will use these symbols to hide differences between"
-                   print  " * termios/termio/sgttyb interfaces."
-                   print  " */"
-                   print  "#undef  TTY"
-                   print  "#undef  SET_TTY"
-                   print  "#undef  GET_TTY"
-                   print  ""
-                   print  "/* Assume POSIX termio if we have the header and function */"
-                   print  "/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */"
-                   print  "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@"
-                   print  ""
-                   print  "#undef  TERMIOS"
-                   print  "#define TERMIOS 1"
-                   print  ""
-                   print  "#include <termios.h>"
-                   print  "#define TTY struct termios"
-                   print  ""
-                   print  "#else /* !HAVE_TERMIOS_H */"
-                   print  ""
-                   print  "/* #if HAVE_TERMIO_H */"
-                   print  "#if @HAVE_TERMIO_H@"
-                   print  ""
-                   print  "#undef  TERMIOS"
-                   print  "#define TERMIOS 1"
-                   print  ""
-                   print  "#include <termio.h>"
-                   print  "#define TTY struct termio"
-                   print  ""
-                   print  "#else /* !HAVE_TERMIO_H */"
-                   print  ""
-                   print  "#if __MINGW32__"
-                   print  "#  include <ncurses_mingw.h>"
-                   print  "#  define TTY struct termios"
-                   print  "#else"
-                   print  "#undef TERMIOS"
-                   print  "#include <sgtty.h>"
-                   print  "#include <sys/ioctl.h>"
-                   print  "#define TTY struct sgttyb"
-                   print  "#endif /* MINGW32 */"
-                   print  "#endif /* HAVE_TERMIO_H */"
-                   print  ""
-                   print  "#endif /* HAVE_TERMIOS_H */"
-                   print  ""
-                   print  "#ifdef TERMIOS"
-                   print  "#define GET_TTY(fd, buf) tcgetattr(fd, buf)"
-                   print  "#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)"
-                   print  "#else"
-                   print  "#define GET_TTY(fd, buf) gtty(fd, buf)"
-                   print  "#define SET_TTY(fd, buf) stty(fd, buf)"
-                   print  "#endif"
-                   print  ""
-                   print  "#define NAMESIZE 256"
-                   print  ""
-                   print  "/* The cast works because TERMTYPE is the first data in TERMINAL */"
-                   print  "#define CUR ((TERMTYPE *)(cur_term))->"
-                   print  ""
-               }
+BEGIN {
+       lcurl = "{";
+       rcurl = "}";
+       print  "/****************************************************************************"
+       print  " * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc.              *"
+       print  " *                                                                          *"
+       print  " * Permission is hereby granted, free of charge, to any person obtaining a  *"
+       print  " * copy of this software and associated documentation files (the            *"
+       print  " * \"Software\"), to deal in the Software without restriction, including      *"
+       print  " * without limitation the rights to use, copy, modify, merge, publish,      *"
+       print  " * distribute, distribute with modifications, sublicense, and/or sell       *"
+       print  " * copies of the Software, and to permit persons to whom the Software is    *"
+       print  " * furnished to do so, subject to the following conditions:                 *"
+       print  " *                                                                          *"
+       print  " * The above copyright notice and this permission notice shall be included  *"
+       print  " * in all copies or substantial portions of the Software.                   *"
+       print  " *                                                                          *"
+       print  " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *"
+       print  " * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *"
+       print  " * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *"
+       print  " * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *"
+       print  " * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *"
+       print  " * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *"
+       print  " * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *"
+       print  " *                                                                          *"
+       print  " * Except as contained in this notice, the name(s) of the above copyright   *"
+       print  " * holders shall not be used in advertising or otherwise to promote the     *"
+       print  " * sale, use or other dealings in this Software without prior written       *"
+       print  " * authorization.                                                           *"
+       print  " ****************************************************************************/"
+       print  ""
+       print  "/****************************************************************************/"
+       print  "/* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995                */"
+       print  "/*    and: Eric S. Raymond <esr@snark.thyrsus.com>                          */"
+       print  "/*    and: Thomas E. Dickey                        1995-on                  */"
+       print  "/****************************************************************************/"
+       print  ""
+       print  "/* $Id: MKterm.h.awk.in,v 1.66 2017/04/03 08:16:54 tom Exp $ */"
+       print  ""
+       print  "/*"
+       print  "**      term.h -- Definition of struct term"
+       print  "*/"
+       print  ""
+       print  "#ifndef NCURSES_TERM_H_incl"
+       print  "#define NCURSES_TERM_H_incl 1"
+       print  ""
+       print  "#undef  NCURSES_VERSION"
+       print  "#define NCURSES_VERSION \"@NCURSES_MAJOR@.@NCURSES_MINOR@\""
+       print  ""
+       print  "#include <ncurses_dll.h>"
+       print  ""
+       print  "#ifdef __cplusplus"
+       printf "extern \"C\" %s\n", lcurl;
+       print  "#endif"
+       print  ""
+       print  "/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H"
+       print  " * definition (based on the system for which this was configured)."
+       print  " */"
+       print  ""
+       print  "#undef  NCURSES_CONST"
+       print  "#define NCURSES_CONST @NCURSES_CONST@"
+       print  ""
+       print  "#undef  NCURSES_SBOOL"
+       print  "#define NCURSES_SBOOL @NCURSES_SBOOL@"
+       print  ""
+       print  "#undef  NCURSES_USE_DATABASE"
+       print  "#define NCURSES_USE_DATABASE @NCURSES_USE_DATABASE@"
+       print  ""
+       print  "#undef  NCURSES_USE_TERMCAP"
+       print  "#define NCURSES_USE_TERMCAP @NCURSES_USE_TERMCAP@"
+       print  ""
+       print  "#undef  NCURSES_XNAMES"
+       print  "#define NCURSES_XNAMES @NCURSES_XNAMES@"
+       print  ""
+       print  "/* We will use these symbols to hide differences between"
+       print  " * termios/termio/sgttyb interfaces."
+       print  " */"
+       print  "#undef  TTY"
+       print  "#undef  SET_TTY"
+       print  "#undef  GET_TTY"
+       print  ""
+       print  "/* Assume POSIX termio if we have the header and function */"
+       print  "/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */"
+       print  "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@"
+       print  ""
+       print  "#undef  TERMIOS"
+       print  "#define TERMIOS 1"
+       print  ""
+       print  "#include <termios.h>"
+       print  "#define TTY struct termios"
+       print  ""
+       print  "#else /* !HAVE_TERMIOS_H */"
+       print  ""
+       print  "/* #if HAVE_TERMIO_H */"
+       print  "#if @HAVE_TERMIO_H@"
+       print  ""
+       print  "#undef  TERMIOS"
+       print  "#define TERMIOS 1"
+       print  ""
+       print  "#include <termio.h>"
+       print  "#define TTY struct termio"
+       print  ""
+       print  "#else /* !HAVE_TERMIO_H */"
+       print  ""
+       print  "#if __MINGW32__"
+       print  "#  include <ncurses_mingw.h>"
+       print  "#  define TTY struct termios"
+       print  "#else"
+       print  "#undef TERMIOS"
+       print  "#include <sgtty.h>"
+       print  "#include <sys/ioctl.h>"
+       print  "#define TTY struct sgttyb"
+       print  "#endif /* MINGW32 */"
+       print  "#endif /* HAVE_TERMIO_H */"
+       print  ""
+       print  "#endif /* HAVE_TERMIOS_H */"
+       print  ""
+       print  "#ifdef TERMIOS"
+       print  "#define GET_TTY(fd, buf) tcgetattr(fd, buf)"
+       print  "#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)"
+       print  "#else"
+       print  "#define GET_TTY(fd, buf) gtty(fd, buf)"
+       print  "#define SET_TTY(fd, buf) stty(fd, buf)"
+       print  "#endif"
+       print  ""
+       print  "#define NAMESIZE 256"
+       print  ""
+       print  "/* The cast works because TERMTYPE is the first data in TERMINAL */"
+       print  "#define CUR ((TERMTYPE *)(cur_term))->"
+       print  ""
+}
 
-$2 == "%%-STOP-HERE-%%"        {
-                       print  ""
-                       printf "#define BOOLWRITE %d\n", BoolCount
-                       printf "#define NUMWRITE  %d\n", NumberCount
-                       printf "#define STRWRITE  %d\n", StringCount
-                       print  ""
-                       print  "/* older synonyms for some capabilities */"
-                       print  "#define beehive_glitch  no_esc_ctlc"
-                       print  "#define teleray_glitch  dest_tabs_magic_smso"
-                       print  "#define micro_char_size micro_col_size"
-                       print  ""
-                       print  "#ifdef __INTERNAL_CAPS_VISIBLE"
-               }
+$2 == "%%-STOP-HERE-%%" {
+       print  ""
+       printf "#define BOOLWRITE %d\n", BoolCount
+       printf "#define NUMWRITE  %d\n", NumberCount
+       printf "#define STRWRITE  %d\n", StringCount
+       print  ""
+       print  "/* older synonyms for some capabilities */"
+       print  "#define beehive_glitch  no_esc_ctlc"
+       print  "#define teleray_glitch  dest_tabs_magic_smso"
+       print  "#define micro_char_size micro_col_size"
+       print  ""
+       print  "#ifdef __INTERNAL_CAPS_VISIBLE"
+}
 
-/^#/           {next;}
+/^#/ {
+       next;
+}
 
-$1 == "acs_chars"      {acsindex = StringCount}
+$1 == "acs_chars" {
+       acsindex = StringCount;
+}
 
-$3 == "bool"   {
-                   printf "#define %-30s CUR Booleans[%d]\n", $1, BoolCount++
-               }
+$3 == "bool" {
+       printf "#define %-30s CUR Booleans[%d]\n", $1, BoolCount++
+}
 
-$3 == "num"    {
-                   printf "#define %-30s CUR Numbers[%d]\n", $1, NumberCount++
-               }
+$3 == "num" {
+       printf "#define %-30s CUR Numbers[%d]\n", $1, NumberCount++
+}
 
-$3 == "str"    {
-                   printf "#define %-30s CUR Strings[%d]\n", $1, StringCount++
-               }
+$3 == "str" {
+       printf "#define %-30s CUR Strings[%d]\n", $1, StringCount++
+}
 
-END            {
-                       print  "#endif /* __INTERNAL_CAPS_VISIBLE */"
-                       print  ""
-                       print  ""
-                       print  "/*"
-                       print  " * Predefined terminfo array sizes"
-                       print  " */"
-                       printf "#define BOOLCOUNT %d\n", BoolCount
-                       printf "#define NUMCOUNT  %d\n", NumberCount
-                       printf "#define STRCOUNT  %d\n", StringCount
-                       print  ""
-                       print  "/* used by code for comparing entries */"
-                       print  "#define acs_chars_index ", acsindex
-                       print  ""
-                       print  "typedef struct termtype {       /* in-core form of terminfo data */"
-                       print  "    char  *term_names;          /* str_table offset of term names */"
-                       print  "    char  *str_table;           /* pointer to string table */"
-                       print  "    NCURSES_SBOOL  *Booleans;   /* array of boolean values */"
-                       print  "    short *Numbers;             /* array of integer values */"
-                       print  "    char  **Strings;            /* array of string offsets */"
-                       print  ""
-                       print  "#if NCURSES_XNAMES"
-                       print  "    char  *ext_str_table;       /* pointer to extended string table */"
-                       print  "    char  **ext_Names;          /* corresponding names */"
-                       print  ""
-                       print  "    unsigned short num_Booleans;/* count total Booleans */"
-                       print  "    unsigned short num_Numbers; /* count total Numbers */"
-                       print  "    unsigned short num_Strings; /* count total Strings */"
-                       print  ""
-                       print  "    unsigned short ext_Booleans;/* count extensions to Booleans */"
-                       print  "    unsigned short ext_Numbers; /* count extensions to Numbers */"
-                       print  "    unsigned short ext_Strings; /* count extensions to Strings */"
-                       print  "#endif /* NCURSES_XNAMES */"
-                       print  ""
-                       print  "} TERMTYPE;"
-                       print  ""
-                       print  "/*"
-                       print  " * The only reason these structures are visible is for read-only use."
-                       print  " * Programs which modify the data are not, never were, portable across"
-                       print  " * curses implementations."
-                       print  " */"
-                       print  "#ifdef NCURSES_INTERNALS"
-                       print  "typedef struct term {           /* describe an actual terminal */"
-                       print  "    TERMTYPE    type;           /* terminal type description */"
-                       print  "    short       Filedes;        /* file description being written to */"
-                       print  "    TTY         Ottyb;          /* original state of the terminal */"
-                       print  "    TTY         Nttyb;          /* current state of the terminal */"
-                       print  "    int         _baudrate;      /* used to compute padding */"
-                       print  "    char *      _termname;      /* used for termname() */"
-                       print  "} TERMINAL;"
-                       print  "#else"
-                       print  "typedef struct term TERMINAL;"
-                       print  "#endif /* NCURSES_INTERNALS */"
-                       print  ""
-                       print  ""
-                       print  "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@"
-                       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
-                       print  "#elif @cf_cv_enable_reentrant@"
-                       print  "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
-                       print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
-                       print  "#else"
-                       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
-                       print  "#endif"
-                       print  ""
-                       print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
-                       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
-                       print  ""
-                       print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
-                       print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
-                       print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
-                       print  "#define numnames   NCURSES_PUBLIC_VAR(numnames())"
-                       print  "#define numcodes   NCURSES_PUBLIC_VAR(numcodes())"
-                       print  "#define numfnames  NCURSES_PUBLIC_VAR(numfnames())"
-                       print  "#define strnames   NCURSES_PUBLIC_VAR(strnames())"
-                       print  "#define strcodes   NCURSES_PUBLIC_VAR(strcodes())"
-                       print  "#define strfnames  NCURSES_PUBLIC_VAR(strfnames())"
-                       print  ""
-                       print  "#else"
-                       print  ""
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];"
-                       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];"
-                       print  ""
-                       print  "#endif"
-                       print  ""
-                       print  "/*"
-                       print  " * These entrypoints are used only by the ncurses utilities such as tic."
-                       print  " */"
-                       print  "#ifdef NCURSES_INTERNALS"
-                       print  ""
-                       print  "extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);"
-                       print  "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);"
-                       print  "extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE *const);"
-                       print  "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);"
-                       print  "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);"
-                       print  "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);"
-                       print  ""
-                       print  "#endif /* NCURSES_INTERNALS */"
-                       print  ""
-                       print  ""
-                       print  "/*"
-                       print  " * These entrypoints are used by tack."
-                       print  " */"
-                       print  "extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);"
-                       print  "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);"
-                       print  ""
-                       print  "/* Normal entry points */"
-                       print  "extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);"
-                       print  "extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);"
-                       print  ""
-                       print  "/* miscellaneous entry points */"
-                       print  "extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);"
-                       print  "extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *);"
-                       print  ""
-                       print  "/* terminfo entry points, also declared in curses.h */"
-                       print  "#if !defined(__NCURSES_H)"
-                       print  "extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT_VAR(char) ttytype[];"
-                       print  "extern NCURSES_EXPORT(int) putp (const char *);"
-                       print  "extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);"
-                       print  ""
-                       print  "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
-                       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);        /* special */"
-                       print  "#else"
-                       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);       /* special */"
-                       print  "extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...);        /* special */"
-                       print  "#endif"
-                       print  ""
-                       print  "extern NCURSES_EXPORT(char *) tiparm (const char *, ...);               /* special */"
-                       print  ""
-                       print  "#endif /* __NCURSES_H */"
-                       print  ""
-                       print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
-                       print  "#if !defined(NCURSES_TERMCAP_H_incl)"
-                       print  "extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);"
-                       print  "extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);"
-                       print  "extern NCURSES_EXPORT(int) tgetent (char *, const char *);"
-                       print  "extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));"
-                       print  "#endif /* NCURSES_TERMCAP_H_incl */"
-                       print  ""
-                       print  "/*"
-                       print  " * Include curses.h before term.h to enable these extensions."
-                       print  " */"
-                       print  "#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)"
-                       print  ""
-                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tigetstr) (SCREEN*, NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(putp) (SCREEN*, const char *);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetflag) (SCREEN*, NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetnum) (SCREEN*, NCURSES_CONST char *);"
-                       print  ""
-                       print  "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
-                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, ...);     /* special */"
-                       print  "#else"
-                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);    /* special */"
-                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm_varargs) (SCREEN*, NCURSES_CONST char *, ...);     /* special */"
-                       print  "#endif"
-                       print  ""
-                       print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
-                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgetstr) (SCREEN*, NCURSES_CONST char *, char **);"
-                       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetflag) (SCREEN*, NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetnum) (SCREEN*, NCURSES_CONST char *);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);"
-                       print  ""
-                       print  "extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);"
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);"
-                       print  ""
-                       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);"
-                       print  "#endif /* NCURSES_SP_FUNCS */"
-                       print  ""
-                       print  "#ifdef __cplusplus"
-                       print  "}"
-                       print  "#endif"
-                       print  ""
-                       print  "#endif /* NCURSES_TERM_H_incl */"
-               }
+END {
+       print  "#endif /* __INTERNAL_CAPS_VISIBLE */"
+       print  ""
+       print  ""
+       print  "/*"
+       print  " * Predefined terminfo array sizes"
+       print  " */"
+       printf "#define BOOLCOUNT %d\n", BoolCount
+       printf "#define NUMCOUNT  %d\n", NumberCount
+       printf "#define STRCOUNT  %d\n", StringCount
+       print  ""
+       print  "/* used by code for comparing entries */"
+       print  "#define acs_chars_index ", acsindex
+       print  ""
+       print  "typedef struct termtype {       /* in-core form of terminfo data */"
+       print  "    char  *term_names;          /* str_table offset of term names */"
+       print  "    char  *str_table;           /* pointer to string table */"
+       print  "    NCURSES_SBOOL  *Booleans;   /* array of boolean values */"
+       print  "    short *Numbers;             /* array of integer values */"
+       print  "    char  **Strings;            /* array of string offsets */"
+       print  ""
+       print  "#if NCURSES_XNAMES"
+       print  "    char  *ext_str_table;       /* pointer to extended string table */"
+       print  "    char  **ext_Names;          /* corresponding names */"
+       print  ""
+       print  "    unsigned short num_Booleans;/* count total Booleans */"
+       print  "    unsigned short num_Numbers; /* count total Numbers */"
+       print  "    unsigned short num_Strings; /* count total Strings */"
+       print  ""
+       print  "    unsigned short ext_Booleans;/* count extensions to Booleans */"
+       print  "    unsigned short ext_Numbers; /* count extensions to Numbers */"
+       print  "    unsigned short ext_Strings; /* count extensions to Strings */"
+       print  "#endif /* NCURSES_XNAMES */"
+       print  ""
+       print  "} TERMTYPE;"
+       print  ""
+       print  "/*"
+       print  " * The only reason these structures are visible is for read-only use."
+       print  " * Programs which modify the data are not, never were, portable across"
+       print  " * curses implementations."
+       print  " */"
+       print  "#ifdef NCURSES_INTERNALS"
+       print  "typedef struct term {           /* describe an actual terminal */"
+       print  "    TERMTYPE    type;           /* terminal type description */"
+       print  "    short       Filedes;        /* file description being written to */"
+       print  "    TTY         Ottyb;          /* original state of the terminal */"
+       print  "    TTY         Nttyb;          /* current state of the terminal */"
+       print  "    int         _baudrate;      /* used to compute padding */"
+       print  "    char *      _termname;      /* used for termname() */"
+       print  "} TERMINAL;"
+       print  "#else"
+       print  "typedef struct term TERMINAL;"
+       print  "#endif /* NCURSES_INTERNALS */"
+       print  ""
+       print  ""
+       print  "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@"
+       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+       print  "#elif @cf_cv_enable_reentrant@"
+       print  "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
+       print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
+       print  "#else"
+       print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+       print  "#endif"
+       print  ""
+       print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
+       print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
+       print  ""
+       print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
+       print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
+       print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
+       print  "#define numnames   NCURSES_PUBLIC_VAR(numnames())"
+       print  "#define numcodes   NCURSES_PUBLIC_VAR(numcodes())"
+       print  "#define numfnames  NCURSES_PUBLIC_VAR(numfnames())"
+       print  "#define strnames   NCURSES_PUBLIC_VAR(strnames())"
+       print  "#define strcodes   NCURSES_PUBLIC_VAR(strcodes())"
+       print  "#define strfnames  NCURSES_PUBLIC_VAR(strfnames())"
+       print  ""
+       print  "#else"
+       print  ""
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];"
+       print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];"
+       print  ""
+       print  "#endif"
+       print  ""
+       print  "/*"
+       print  " * These entrypoints are used only by the ncurses utilities such as tic."
+       print  " */"
+       print  "#ifdef NCURSES_INTERNALS"
+       print  ""
+       print  "extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);"
+       print  "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);"
+       print  "extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE *const);"
+       print  "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);"
+       print  "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);"
+       print  "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);"
+       print  ""
+       print  "#endif /* NCURSES_INTERNALS */"
+       print  ""
+       print  ""
+       print  "/*"
+       print  " * These entrypoints are used by tack."
+       print  " */"
+       print  "extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);"
+       print  "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);"
+       print  ""
+       print  "/* Normal entry points */"
+       print  "extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);"
+       print  "extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);"
+       print  ""
+       print  "/* miscellaneous entry points */"
+       print  "extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);"
+       print  "extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *);"
+       print  ""
+       print  "/* terminfo entry points, also declared in curses.h */"
+       print  "#if !defined(__NCURSES_H)"
+       print  "extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT_VAR(char) ttytype[];"
+       print  "extern NCURSES_EXPORT(int) putp (const char *);"
+       print  "extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);"
+       print  ""
+       print  "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
+       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);        /* special */"
+       print  "#else"
+       print  "extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);       /* special */"
+       print  "extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...);        /* special */"
+       print  "#endif"
+       print  ""
+       print  "extern NCURSES_EXPORT(char *) tiparm (const char *, ...);               /* special */"
+       print  ""
+       print  "#endif /* __NCURSES_H */"
+       print  ""
+       print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
+       print  "#if !defined(NCURSES_TERMCAP_H_incl)"
+       print  "extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);"
+       print  "extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);"
+       print  "extern NCURSES_EXPORT(int) tgetent (char *, const char *);"
+       print  "extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));"
+       print  "#endif /* NCURSES_TERMCAP_H_incl */"
+       print  ""
+       print  "/*"
+       print  " * Include curses.h before term.h to enable these extensions."
+       print  " */"
+       print  "#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)"
+       print  ""
+       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tigetstr) (SCREEN*, NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(putp) (SCREEN*, const char *);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetflag) (SCREEN*, NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetnum) (SCREEN*, NCURSES_CONST char *);"
+       print  ""
+       print  "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
+       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, ...);     /* special */"
+       print  "#else"
+       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);    /* special */"
+       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm_varargs) (SCREEN*, NCURSES_CONST char *, ...);     /* special */"
+       print  "#endif"
+       print  ""
+       print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
+       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgetstr) (SCREEN*, NCURSES_CONST char *, char **);"
+       print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetflag) (SCREEN*, NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetnum) (SCREEN*, NCURSES_CONST char *);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);"
+       print  ""
+       print  "extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);"
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);"
+       print  ""
+       print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);"
+       print  "#endif /* NCURSES_SP_FUNCS */"
+       print  ""
+       print  "#ifdef __cplusplus"
+       printf "%s\n", rcurl;
+       print  "#endif"
+       print  ""
+       print  "#endif /* NCURSES_TERM_H_incl */"
+}
index b47d915849d9339a212c3ed4269923963d4c9088..c0222d057d41898fd6f3d958702f3cec4be0e991 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1998-on                 *
  ****************************************************************************/
 
-/* $Id: term_entry.h,v 1.49 2017/03/18 18:52:12 tom Exp $ */
+/* $Id: term_entry.h,v 1.54 2017/04/03 21:36:00 tom Exp $ */
 
 /*
  *     term_entry.h -- interface to entry-manipulation code
@@ -40,6 +40,7 @@
 
 #ifndef NCURSES_TERM_ENTRY_H_incl
 #define NCURSES_TERM_ENTRY_H_incl 1
+/* *INDENT-OFF* */
 
 #ifdef __cplusplus
 extern "C" {
@@ -47,46 +48,9 @@ extern "C" {
 
 #include <term.h>
 
-    /*
-     * see db_iterator.c - this enumeration lists the places searched for a
-     * terminal description and defines the order in which they are searched.
-     */
-    typedef enum {
-       dbdTIC = 0,             /* special, used by tic when writing entry */
-#if NCURSES_USE_DATABASE
-       dbdEnvOnce,             /* the $TERMINFO environment variable */
-       dbdHome,                /* $HOME/.terminfo */
-       dbdEnvList,             /* the $TERMINFO_DIRS environment variable */
-       dbdCfgList,             /* the compiled-in TERMINFO_DIRS value */
-       dbdCfgOnce,             /* the compiled-in TERMINFO value */
-#endif
-#if NCURSES_USE_TERMCAP
-       dbdEnvOnce2,            /* the $TERMCAP environment variable */
-       dbdEnvList2,            /* the $TERMPATH environment variable */
-       dbdCfgList2,            /* the compiled-in TERMPATH */
-#endif
-       dbdLAST
-    } DBDIRS;
-
-#define MAX_USES       32
-#define MAX_CROSSLINKS 16
-
-    typedef struct entry {
-       TERMTYPE tterm;
-       unsigned nuses;
-       struct {
-           char *name;
-           struct entry *link;
-           long line;
-       } uses[MAX_USES];
-       int ncrosslinks;
-       struct entry *crosslinks[MAX_CROSSLINKS];
-       long cstart, cend;
-       long startline;
-       struct entry *next;
-       struct entry *last;
-    } ENTRY;
-/* *INDENT-OFF* */
+/*
+ * These macros may be used by programs that know about TERMTYPE:
+ */
 #if NCURSES_XNAMES
 #define NUM_BOOLEANS(tp) (tp)->num_Booleans
 #define NUM_NUMBERS(tp)  (tp)->num_Numbers
@@ -115,6 +79,58 @@ extern "C" {
 #define ExtNumname(tp,i,names)  EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names)
 #define ExtStrname(tp,i,names)  EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names)
 
+/*
+ * The remaining type-definitions and macros are used only internally by the
+ * ncurses utilities.
+ */
+#ifdef NCURSES_INTERNALS
+
+/*
+ * see db_iterator.c - this enumeration lists the places searched for a
+ * terminal description and defines the order in which they are searched.
+ */
+typedef enum {
+       dbdTIC = 0,             /* special, used by tic when writing entry */
+#if NCURSES_USE_DATABASE
+       dbdEnvOnce,             /* the $TERMINFO environment variable */
+       dbdHome,                /* $HOME/.terminfo */
+       dbdEnvList,             /* the $TERMINFO_DIRS environment variable */
+       dbdCfgList,             /* the compiled-in TERMINFO_DIRS value */
+       dbdCfgOnce,             /* the compiled-in TERMINFO value */
+#endif
+#if NCURSES_USE_TERMCAP
+       dbdEnvOnce2,            /* the $TERMCAP environment variable */
+       dbdEnvList2,            /* the $TERMPATH environment variable */
+       dbdCfgList2,            /* the compiled-in TERMPATH */
+#endif
+       dbdLAST
+} DBDIRS;
+
+#define MAX_USES       32
+#define MAX_CROSSLINKS 16
+
+typedef struct entry ENTRY;
+
+typedef struct {
+       char *name;
+       ENTRY *link;
+       long line;
+} ENTRY_USES;
+
+struct entry {
+       TERMTYPE tterm;
+       int *XNumbers;          /* array of integer values */
+       unsigned nuses;
+       ENTRY_USES uses[MAX_USES];
+       int ncrosslinks;
+       ENTRY *crosslinks[MAX_CROSSLINKS];
+       long cstart;
+       long cend;
+       long startline;
+       ENTRY *next;
+       ENTRY *last;
+};
+
 extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head;
 extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
 #define for_entry_list(qp)     for (qp = _nc_head; qp; qp = qp->next)
@@ -131,7 +147,10 @@ extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
 #define PRESENT(s)     (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING))
 
 #define ANDMISSING(p,q) \
-               {if (PRESENT(p) && !PRESENT(q)) _nc_warning(#p " but no " #q);}
+               { \
+               if (PRESENT(p) && !PRESENT(q)) \
+                       _nc_warning(#p " but no " #q); \
+               }
 
 #define PAIRED(p,q) \
                { \
@@ -144,7 +163,6 @@ extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail;
 /*
  * These entrypoints are used only by the ncurses utilities such as tic.
  */
-#ifdef NCURSES_INTERNALS
 
 /* alloc_entry.c: elementary allocation code */
 extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp);
@@ -199,9 +217,10 @@ extern NCURSES_EXPORT(void) _nc_init_acs (void);   /* corresponds to traditional '
 /* free_ttype.c: elementary allocation code */
 extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *);
 
-/* *INDENT-ON* */
-
 #ifdef __cplusplus
 }
 #endif
-#endif                         /* NCURSES_TERM_ENTRY_H_incl */
+
+/* *INDENT-ON* */
+
+#endif /* NCURSES_TERM_ENTRY_H_incl */
index deed47fa5f4c77e6e6a7ab55d27a4427469fc2e6..24426f6b093518dd9b3c5cc537bdce24ec76b56f 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: lib_newterm.c,v 1.95 2017/04/01 12:53:35 tom Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.96 2017/04/02 14:26:18 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define NumLabels      InfoOf(SP_PARM).numlabels
@@ -76,7 +76,7 @@ _nc_initscr(NCURSES_SP_DCL0)
 
     /* for extended XPG4 conformance requires cbreak() at this point */
     /* (SVr4 curses does this anyway) */
-    T((T_CALLED("_nc_initscr(%p) ->term %p"), (void *) SP_PARM, term));
+    T((T_CALLED("_nc_initscr(%p) ->term %p"), (void *) SP_PARM, (void *) term));
     if (NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG) == OK) {
        TTY buf;
 
index 8d475b968e1bb55de64b1a458fd623eecc971f08..854270bc211a44adeb7c793a2283545135ce269d 100644 (file)
@@ -47,7 +47,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_set_term.c,v 1.158 2017/04/01 13:51:59 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.159 2017/04/02 14:26:18 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define MaxColors      InfoOf(sp).maxcolors
@@ -307,7 +307,7 @@ NCURSES_SP_NAME(_nc_setupscreen) (
 
     if (!sp) {
        sp = _nc_alloc_screen_sp();
-       T(("_nc_alloc_screen_sp %p", sp));
+       T(("_nc_alloc_screen_sp %p", (void *) sp));
        *spp = sp;
     }
     if (!sp
index c32887d490daa94ca953d8eb4a76258547c6c8fc..2d182622d100c86d90df7901f567246eb09529c6 100644 (file)
@@ -48,7 +48,7 @@
 #include <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.173 2017/04/01 13:48:38 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.174 2017/04/02 14:26:18 tom Exp $")
 
 /****************************************************************************
  *
@@ -825,7 +825,7 @@ new_prescr(void)
     T((T_CALLED("new_prescr()")));
 
     sp = _nc_alloc_screen_sp();
-    T(("_nc_alloc_screen_sp %p", sp));
+    T(("_nc_alloc_screen_sp %p", (void *) sp));
     if (sp != 0) {
        sp->rsp = sp->rippedoff;
        sp->_filtered = _nc_prescreen.filter_mode;
index f4450d7409f3db4d9c7b6be567c3989d29ab4d52..cf065cb68a8bd1807d3296ed03c459532d03d89e 100644 (file)
@@ -41,7 +41,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_ttyflags.c,v 1.32 2017/04/01 11:48:03 tom Exp $")
+MODULE_ID("$Id: lib_ttyflags.c,v 1.33 2017/04/02 14:30:26 tom Exp $")
 
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf)
@@ -141,7 +141,8 @@ NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("def_shell_mode(%p) ->term %p"), (void *) SP_PARM, termp));
+    T((T_CALLED("def_shell_mode(%p) ->term %p"),
+       (void *) SP_PARM, (void *) termp));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
@@ -179,7 +180,7 @@ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("def_prog_mode(%p) ->term %p"), (void *) SP_PARM, termp));
+    T((T_CALLED("def_prog_mode(%p) ->term %p"), (void *) SP_PARM, (void *) termp));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
@@ -215,7 +216,7 @@ NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("reset_prog_mode(%p) ->term %p"), (void *) SP_PARM, termp));
+    T((T_CALLED("reset_prog_mode(%p) ->term %p"), (void *) SP_PARM, (void *) termp));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
@@ -247,7 +248,8 @@ NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0)
     int rc = ERR;
     TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("reset_shell_mode(%p) ->term %p"), (void *) SP_PARM, termp));
+    T((T_CALLED("reset_shell_mode(%p) ->term %p"),
+       (void *) SP_PARM, (void *) termp));
 
     if (termp != 0) {
 #ifdef USE_TERM_DRIVER
index 339c7c821648e315365cd1b252e022f9995259f6..802b520fa55dd2b7eb2078b47bd58fe5c83aa93f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,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            *
@@ -47,7 +47,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: parse_entry.c,v 1.81 2016/05/28 23:22:52 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.82 2017/04/03 09:00:45 tom Exp $")
 
 #ifdef LINT
 static short const parametrized[] =
@@ -206,7 +206,7 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type)
 #define MAX_NUMBER 0x7fff      /* positive shorts only */
 
 NCURSES_EXPORT(int)
-_nc_parse_entry(struct entry *entryp, int literal, bool silent)
+_nc_parse_entry(ENTRY *entryp, int literal, bool silent)
 {
     int token_type;
     struct name_table_entry const *entry_ptr;
index 103dfdc4523268d10d93341251652ab691729961..57f142b7cad9912428dbbc800fea4ac7d7f18887 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2011,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_ins_wch.c,v 1.21 2016/05/28 22:32:11 tom Exp $")
+MODULE_ID("$Id: lib_ins_wch.c,v 1.22 2017/04/08 22:52:26 tom Exp $")
 
 /*
  * Insert the given character, updating the current location to simplify
@@ -119,7 +119,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
            NCURSES_SIZE_T oy = win->_cury;
            NCURSES_SIZE_T ox = win->_curx;
 
-           for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
+           for (cp = wstr; ((cp - wstr) < n) && *cp; cp++) {
                int len = wcwidth(*cp);
 
                if ((len >= 0 && len != 1) || !is7bits(*cp)) {
index e4065743cc59bda427d6a73af0f192679f3c297b..b2710ff97fb2920c5d0180e85ba08e93be6deebd 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170401) unstable; urgency=low
+ncurses6 (6.0+20170408) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 26 Mar 2017 09:39:03 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 02 Apr 2017 06:36:57 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index e4065743cc59bda427d6a73af0f192679f3c297b..b2710ff97fb2920c5d0180e85ba08e93be6deebd 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170401) unstable; urgency=low
+ncurses6 (6.0+20170408) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 26 Mar 2017 09:39:03 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 02 Apr 2017 06:36:57 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index c8f7a3ce7de892cd23b52c030482f2958dd4cc25..29f1d05f416c818621c2a9dfd018d66bb9918fc0 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170401) unstable; urgency=low
+ncurses6 (6.0+20170408) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 26 Mar 2017 09:39:03 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 02 Apr 2017 06:36:57 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index e67e144913f7a8021e52fc46cc336c3899acf71b..c0bfb2c0da69885d83cb6cadc258ccb4485a311a 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.205 2017/03/26 13:39:03 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.206 2017/04/02 10:36:57 tom Exp $\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_MMDD  "0401"\r
+!define VERSION_MMDD  "0408"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 0e802ba524943d418e7f4f2a799af16c850210e1..73a2bb4058900ef873e768a9975a8974072467e0 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
-Release: 20170401
+Release: 20170408
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 3c038cd749e40330767b9dffb498dfeb3d02e1d8..b6ca9aa940bdf77575c0633aa6ed4d9199f8aadd 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
-Release: 20170401
+Release: 20170408
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index aeb92f30a6caf6320462ae66941921c8a66dbde0..cb9a333bff0d72bb0f3f265a99599ccef7bd636a 100644 (file)
--- a/test/bs.c
+++ b/test/bs.c
@@ -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            *
@@ -34,7 +34,7 @@
  * v2.0 featuring strict ANSI/POSIX conformance, November 1993.
  * v2.1 with ncurses mouse support, September 1995
  *
- * $Id: bs.c,v 1.64 2016/08/21 00:03:32 tom Exp $
+ * $Id: bs.c,v 1.65 2017/04/08 21:06:16 tom Exp $
  */
 
 #include <test.priv.h>
@@ -185,6 +185,7 @@ uninitgame(int sig GCC_UNUSED)
     (void) reset_shell_mode();
     (void) echo();
     (void) endwin();
+    free(your_name);
     ExitProgram(sig ? EXIT_FAILURE : EXIT_SUCCESS);
 }
 
@@ -224,7 +225,7 @@ intro(void)
        (your_name = strdup(tmpname)) != 0) {
        your_name[0] = (char) toupper(UChar(your_name[0]));
     } else {
-       your_name = dftname;
+       your_name = strdup(dftname);
     }
 
     (void) initscr();
index aef725a0d5e5f1deb8f6660c109650ea32614e9c..a0d069c06011cd6349d934e7c2796bc507a6c072 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_new_pair.c,v 1.10 2017/03/10 09:47:15 tom Exp $
+ * $Id: demo_new_pair.c,v 1.11 2017/04/08 21:48:53 tom Exp $
  *
  * Demonstrate the alloc_pair() function.
  */
 
 #if HAVE_ALLOC_PAIR && USE_WIDEC_SUPPORT
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
 #define MAX_BITS 8             /* all but A_ALTCHARSET */
 #define MAX_ATTR ((1<<MAX_BITS)-1)
 
@@ -210,6 +214,7 @@ main(int argc, char *argv[])
     wchar_t wch[2];
     time_t start = now();
     long total_cells = 0;
+    FILE *output = 0;
 
     setlocale(LC_ALL, "");
 
@@ -233,7 +238,15 @@ main(int argc, char *argv[])
        }
     }
 
-    if (newterm(NULL, stderr, stdin) == 0)
+    if (isatty(fileno(stderr))) {
+       output = stderr;
+    } else if ((ch = open("/dev/tty", O_WRONLY)) != 0) {
+       output = fdopen(ch, "w");
+    } else {
+       fprintf(stderr, "cannot open terminal for output\n");
+       ExitProgram(EXIT_FAILURE);
+    }
+    if (newterm(NULL, output, stdin) == 0)
        usage();
     (void) cbreak();           /* read chars without wait for \n */
     (void) noecho();           /* don't echo input */
index 1a95b00f7a49827a9984c8e02155ec3103aa8161..e6322fdcc20e82f2505a5f4f968348ff6c2d359d 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_termcap.c,v 1.52 2017/03/18 22:03:07 tom Exp $
+ * $Id: demo_termcap.c,v 1.53 2017/04/08 19:08:42 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -157,6 +157,7 @@ next_dbitem(void)
     return result;
 }
 
+#if NO_LEAKS
 static void
 free_dblist(void)
 {
@@ -168,6 +169,7 @@ free_dblist(void)
        db_list = 0;
     }
 }
+#endif /* NO_LEAKS */
 
 static void
 show_string(const char *name, const char *value)
@@ -715,7 +717,18 @@ copy_code_list(NCURSES_CONST char *const *list)
 
     return result;
 }
-#endif
+
+#if NO_LEAKS
+static void
+free_code_list(char **list)
+{
+    if (list) {
+       free(list[0]);
+       free(list);
+    }
+}
+#endif /* NO_LEAKS */
+#endif /* USE_CODE_LISTS */
 
 static void
 usage(void)
@@ -875,7 +888,14 @@ main(int argc, char *argv[])
     }
 #endif
 
+#if NO_LEAKS
     free_dblist();
+#if USE_CODE_LISTS
+    free_code_list(my_boolcodes);
+    free_code_list(my_numcodes);
+    free_code_list(my_strcodes);
+#endif
+#endif /* NO_LEAKS */
 
     ExitProgram(EXIT_SUCCESS);
 }
index 5028e0ce9d863267923dbdcbb68fb871b71049e1..7de1919e78a1953efd5220658c25870a83e1fc9a 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_terminfo.c,v 1.45 2017/03/18 22:03:07 tom Exp $
+ * $Id: demo_terminfo.c,v 1.47 2017/04/09 00:27:42 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -152,7 +152,7 @@ next_dbitem(void)
     return result;
 }
 
-#ifdef NO_LEAKS
+#if NO_LEAKS
 static void
 free_dblist(void)
 {
@@ -751,7 +751,18 @@ copy_code_list(NCURSES_CONST char *const *list)
 
     return result;
 }
+
+#if NO_LEAKS
+static void
+free_code_list(char **list)
+{
+    if (list) {
+       free(list[0]);
+       free(list);
+    }
+}
 #endif
+#endif /* USE_CODE_LISTS */
 
 static void
 usage(void)
@@ -904,17 +915,26 @@ main(int argc, char *argv[])
           PLURAL(total_n_values),
           PLURAL(total_s_values));
 
-#ifdef NO_LEAKS
+#if NO_LEAKS
     free_dblist();
-    if (my_blob != 0) {
-       free(my_blob);
-       free(my_boolcodes);
-       free(my_numcodes);
-       free(my_numvalues);
-       free(my_strcodes);
-       free(my_strvalues);
+    if (input_name != 0) {
+       if (my_blob != 0) {
+           free(my_blob);
+           free(my_boolcodes);
+           free(my_numcodes);
+           free(my_numvalues);
+           free(my_strcodes);
+           free(my_strvalues);
+       }
+    }
+#if USE_CODE_LISTS
+    else {
+       free_code_list(my_boolcodes);
+       free_code_list(my_numcodes);
+       free_code_list(my_strcodes);
     }
 #endif
+#endif /* NO_LEAKS */
 
     ExitProgram(EXIT_SUCCESS);
 }
index c9ac29ade8ce2e99d074dbd7faf5260838993f45..b2cf99bbef78f73accb2f7e0fb8f62c1607b1bbd 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2012,2014 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-2014,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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: echochar.c,v 1.10 2014/08/09 22:35:51 tom Exp $
+ * $Id: echochar.c,v 1.11 2017/04/08 21:53:51 tom Exp $
  *
  * Demonstrate the echochar function (compare to dots.c).
  * Thomas Dickey - 2006/11/4
@@ -69,12 +69,14 @@ static void
 set_color(char *my_pairs, int fg, int bg)
 {
     int pair = (fg * COLORS) + bg;
-    if (!my_pairs[pair]) {
-       init_pair((short) pair,
-                 (short) fg,
-                 (short) bg);
+    if (pair < COLOR_PAIRS) {
+       if (!my_pairs[pair]) {
+           init_pair((short) pair,
+                     (short) fg,
+                     (short) bg);
+       }
+       attron(COLOR_PAIR(pair));
     }
-    attron(COLOR_PAIR(pair));
 }
 
 int
index 9eef8ffd1625de441cf626039ff489eddef27a0e..72064911bf72147391bab0d952385dad0a97b2e3 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: extended_color.c,v 1.8 2017/04/01 19:35:18 tom Exp $
+ * $Id: extended_color.c,v 1.9 2017/04/02 14:30:26 tom Exp $
  */
 
 #include <test.priv.h>
@@ -102,7 +102,7 @@ do_init_color(SCREEN *sp, int color, int adjust)
 static void
 do_color_set(const char *expected, int pair)
 {
-    int i = color_set(pair, NULL);
+    int i = color_set((short) pair, (void *) &pair);
     printw("%s (%s)\n", expected, SHOW(i));
     if (i != OK)
        failed("color_set");
index a5d3ac76a4a4e7a95cf3bd961cbb807bb93d51b8..1bff3a284081c05aff6c644a5994b15bda644ce3 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2014,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: ins_wide.c,v 1.22 2016/09/10 21:35:02 tom Exp $
+ * $Id: ins_wide.c,v 1.23 2017/04/08 22:14:03 tom Exp $
  *
  * Demonstrate the wins_wstr() and wins_wch functions.
  * Thomas Dickey - 2002/11/23
@@ -391,6 +391,8 @@ test_inserts(int level)
            }
            break;
        default:
+           if (length >= BUFSIZ - 2)
+               break;
            buffer[length++] = (wchar_t) ch;
            buffer[length] = '\0';
 
index c70fe1e3b9bce16e778f52fbba16f908264b8c11..9ba373f23fbddef884c474810324c1fc8dfcd195 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2012,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: inserts.c,v 1.28 2016/09/10 21:34:42 tom Exp $
+ * $Id: inserts.c,v 1.29 2017/04/08 22:20:46 tom Exp $
  *
  * Demonstrate the winsstr() and winsch functions.
  * Thomas Dickey - 2002/10/19
@@ -320,6 +320,8 @@ test_inserts(int level)
                beep();
                break;
            }
+           if (length >= BUFSIZ - 2)
+               break;
            buffer[length++] = (char) ch;
            buffer[length] = '\0';
 
index 759469500a40a92f97537dce4ad7795132819681..31c057a0a7f6ef29c38b2340fc37bdf7b0b11982 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: list_keys.c,v 1.18 2017/03/18 22:03:07 tom Exp $
+ * $Id: list_keys.c,v 1.19 2017/04/08 22:57:26 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -159,7 +159,7 @@ show_key(const char *name, bool show)
 }
 
 static bool
-valid_key(const char *name, TERMINAL ** terms, int count)
+valid_key(const char *name, TERMINAL **terms, int count)
 {
     bool result = FALSE;
     if (*name == 'k') {
@@ -266,7 +266,7 @@ modified_key(const char *name)
 }
 
 static void
-list_keys(TERMINAL ** terms, int count)
+list_keys(TERMINAL **terms, int count)
 {
     int j, k;
     int widths0 = 0;
@@ -486,6 +486,8 @@ main(int argc, char *argv[])
        list_keys(terms, 1);
     }
 
+    free(terms);
+
     ExitProgram(EXIT_SUCCESS);
 }
 
index 9effda41a4da145f421aa376aa04f7f48d12cad1..91c7266ad77998834cfe1b499303638342fc08a4 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: movewindow.c,v 1.39 2013/05/04 19:41:02 tom Exp $
+ * $Id: movewindow.c,v 1.40 2017/04/08 23:01:47 tom Exp $
  *
  * Demonstrate move functions for windows and derived windows from the curses
  * library.
@@ -762,5 +762,8 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
        wmove(current_win, 0, 0);
     }
     endwin();
+#if NO_LEAKS
+    free(all_windows);
+#endif
     ExitProgram(EXIT_SUCCESS);
 }
index 5f78aeb18f6f03ee45245375d8d51a4da1df35a1..58ff87d5af212b0e9a1517ad63a76222ab1404eb 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2010-2014,2016 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2009-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_add_wchstr.c,v 1.22 2016/09/10 21:28:40 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.23 2017/04/08 23:10:35 tom Exp $
  *
  * Demonstrate the waddwchstr() and wadd_wch functions.
  * Thomas Dickey - 2009/9/12
@@ -585,6 +585,9 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 
     test_add_wchstr(0);
     endwin();
+#if NO_LEAKS
+    free(temp_buffer);
+#endif
     ExitProgram(EXIT_SUCCESS);
 }
 #else
index 9506fdfb3e30333cf82de9a5b8f65a2e49eff8b4..29bf9d5ecef7e3c5890751995a0b005dfc936a8c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2009-2012,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2009-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_addchstr.c,v 1.19 2016/09/10 21:29:04 tom Exp $
+ * $Id: test_addchstr.c,v 1.20 2017/04/08 23:11:55 tom Exp $
  *
  * Demonstrate the waddchstr() and waddch functions.
  * Thomas Dickey - 2009/9/12
@@ -515,5 +515,8 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 
     test_adds(0);
     endwin();
+#if NO_LEAKS
+    free(temp_buffer);
+#endif
     ExitProgram(EXIT_SUCCESS);
 }
index 627db08e2f3a282710bcac09598411bc9c5fbc1f..e203cc6594780b1eccb3ae60b547e122c25a2894 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2010 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-2010,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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_instr.c,v 1.5 2010/05/01 19:13:46 tom Exp $
+ * $Id: test_instr.c,v 1.6 2017/04/08 23:21:53 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -85,6 +85,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
        return FALSE;
     }
 
+    *buffer = '\0';
     if (level > 1) {
        txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level);
        box(txtbox, 0, 0);
index 509033ed777444b37c94c99c531425e5375664fd..66241b391ca919b0b3fdcd1a1e5483cdbfab7830 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2015,2016 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2015-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            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: test_sgr.c,v 1.8 2016/09/04 23:30:56 tom Exp $
+ * $Id: test_sgr.c,v 1.10 2017/04/09 00:27:42 tom Exp $
  *
  * A simple demo of the sgr/sgr0 terminal capabilities.
  */
@@ -118,7 +118,7 @@ next_dbitem(void)
     return result;
 }
 
-#ifdef NO_LEAKS
+#if NO_LEAKS
 static void
 free_dblist(void)
 {
@@ -286,6 +286,9 @@ brute_force(const char *name)
                }
            }
        }
+       for (count = 0; count < MAXSGR; ++count) {
+           free(values[count]);
+       }
     }
     del_curterm(cur_term);
 }
@@ -349,7 +352,7 @@ main(int argc, char *argv[])
 
     printf("%ld distinct values\n", total_values);
 
-#ifdef NO_LEAKS
+#if NO_LEAKS
     free_dblist();
 #endif
 
index 92bdb254986719d46a2fb42c53a70a11ea14a260..5f645ac6d7bea71044a9c04f41657715da217ade 100644 (file)
@@ -61,7 +61,7 @@ Options:
   traces will be dumped.  The program stops and waits for one character of
   input at the beginning and end of the interval.
 
-  $Id: worm.c,v 1.66 2016/09/17 21:12:30 tom Exp $
+  $Id: worm.c,v 1.67 2017/04/09 00:27:42 tom Exp $
 */
 
 #include <test.priv.h>
@@ -608,7 +608,7 @@ main(int argc, char *argv[])
 
     Trace(("Cleanup"));
     cleanup();
-#ifdef NO_LEAKS
+#if NO_LEAKS
     for (y = 0; y < max_refs; y++) {
        free(refs[y]);
     }