]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20111008
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Oct 2011 00:51:26 +0000 (00:51 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 Oct 2011 00:51:26 +0000 (00:51 +0000)
+ moved static data from db_iterator.c to lib_data.c
+ modify db_iterator.c for memory-leak checking, fix one leak.
+ modify misc/gen-pkgconfig.in to use Requires.private for the parts
  of ncurses rather than Requires, as well as Libs.private for the
  other library dependencies (prompted by Debian #644728).

NEWS
dist.mk
include/term_entry.h
include/tic.h
misc/gen-pkgconfig.in
ncurses/curses.priv.h
ncurses/tinfo/db_iterator.c
ncurses/tinfo/entries.c
ncurses/tinfo/lib_data.c
ncurses/tinfo/make_hash.c

diff --git a/NEWS b/NEWS
index ad2572e84c34012a41f4db8add03d44319c4346a..9795fd681c2e21cc286a711d287dab2827bed9a2 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.1795 2011/09/26 23:48:17 tom Exp $
+-- $Id: NEWS,v 1.1798 2011/10/08 21:06:49 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,13 @@ 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.
 
+20111008
+       + moved static data from db_iterator.c to lib_data.c
+       + modify db_iterator.c for memory-leak checking, fix one leak.
+       + modify misc/gen-pkgconfig.in to use Requires.private for the parts
+         of ncurses rather than Requires, as well as Libs.private for the
+         other library dependencies (prompted by Debian #644728).
+
 20111001
        + modify tic "-K" option to only set the strict-flag rather than force
          source-output.  That allows the same flag to control the parser for
 20111001
        + modify tic "-K" option to only set the strict-flag rather than force
          source-output.  That allows the same flag to control the parser for
diff --git a/dist.mk b/dist.mk
index 9ba5fab1437b7ce1e5d7fb6fc99a7f91d342c96e..e5ee9afe603b088ca924da345b6a46033f545742 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.837 2011/09/25 12:41:00 tom Exp $
+# $Id: dist.mk,v 1.838 2011/10/08 15:25:29 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 = 5
 NCURSES_MINOR = 9
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 9
-NCURSES_PATCH = 20111001
+NCURSES_PATCH = 20111008
 
 # 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 bc715a7eeedb1dfb42d8f804fc25818c8d741e12..1074f167c1c5ebead4bdfa891f1028647fafaca8 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1998-on                 *
  ****************************************************************************/
 
  *     and: Thomas E. Dickey                        1998-on                 *
  ****************************************************************************/
 
-/* $Id: term_entry.h,v 1.39 2011/06/26 09:31:32 tom Exp $ */
+/* $Id: term_entry.h,v 1.40 2011/10/08 21:00:41 tom Exp $ */
 
 /*
  *     term_entry.h -- interface to entry-manipulation code
 
 /*
  *     term_entry.h -- interface to entry-manipulation code
@@ -47,6 +47,24 @@ extern "C" {
 
 #include <term.h>
 
 
 #include <term.h>
 
+/* db_iterator.c */
+typedef enum {
+    dbdTIC = 0,
+#if USE_DATABASE
+    dbdEnvOnce,
+    dbdHome,
+    dbdEnvList,
+    dbdCfgList,
+    dbdCfgOnce,
+#endif
+#if USE_TERMCAP
+    dbdEnvOnce2,
+    dbdEnvList2,
+    dbdCfgList2,
+#endif
+    dbdLAST
+} DBDIRS;
+
 #define MAX_USES       32
 #define MAX_CROSSLINKS 16
 
 #define MAX_USES       32
 #define MAX_CROSSLINKS 16
 
index 94e609354f7b44d964718006b1c740bc12f13dda..21749f9bec77deac68c4bf5b8caa769563b905c6 100644 (file)
@@ -33,7 +33,7 @@
  ****************************************************************************/
 
 /*
  ****************************************************************************/
 
 /*
- * $Id: tic.h,v 1.66 2011/07/30 21:28:43 tom Exp $
+ * $Id: tic.h,v 1.67 2011/10/08 21:00:50 tom Exp $
  *     tic.h - Global variables and structures for the terminfo
  *                     compiler.
  */
  *     tic.h - Global variables and structures for the terminfo
  *                     compiler.
  */
@@ -315,23 +315,6 @@ extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent;             /* Add one for every null sent *
 extern const char * _nc_progname;
 
 /* db_iterator.c */
 extern const char * _nc_progname;
 
 /* db_iterator.c */
-typedef enum {
-    dbdTIC = 0,
-#if USE_DATABASE
-    dbdEnvOnce,
-    dbdHome,
-    dbdEnvList,
-    dbdCfgList,
-    dbdCfgOnce,
-#endif
-#if USE_TERMCAP
-    dbdEnvOnce2,
-    dbdEnvList2,
-    dbdCfgList2,
-#endif
-    dbdLAST
-} DBDIRS;
-
 extern NCURSES_EXPORT(const char *) _nc_next_db(DBDIRS *, int *);
 extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *);
 extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *);
 extern NCURSES_EXPORT(const char *) _nc_next_db(DBDIRS *, int *);
 extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *);
 extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *);
index efd29105b571c33ccf5cfe119e61bb254ad6fa6e..c924bc633fac2d8fb0bd30ca87ae903820c96274 100644 (file)
@@ -1,7 +1,7 @@
 #!@SHELL@
 #!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.8 2010/02/06 22:12:07 Miroslav.Lichvar Exp $
+# $Id: gen-pkgconfig.in,v 1.10 2011/10/08 19:20:15 tom Exp $
 ##############################################################################
 ##############################################################################
-# Copyright (c) 2009,2010 Free Software Foundation, Inc.                     #
+# Copyright (c) 2009-2010,2011 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 "Software"), #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -28,7 +28,7 @@
 # authorization.                                                             #
 ##############################################################################
 #
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey, 2009
+# Author: Thomas E. Dickey
 #
 # The complete configure script for ncurses is the ncurses5-config (or similar
 # name, depending on the flavor, e.g., ncursesw5-config, ncurses6-config, etc).
 #
 # The complete configure script for ncurses is the ncurses5-config (or similar
 # name, depending on the flavor, e.g., ncursesw5-config, ncurses6-config, etc).
@@ -68,6 +68,18 @@ if test $TINFO_NAME = $LIB_NAME ; then
        SUB_LIBRARY_REQ=
 fi
 
        SUB_LIBRARY_REQ=
 fi
 
+if test "$includedir" = "/usr/include" ; then
+       CFLAGS=
+else
+       CFLAGS="-I\${includedir}"
+fi
+
+if test "$libdir" = "/usr/lib" ; then
+       LDFLAGS=
+else
+       LDFLAGS="-L\${libdir}"
+fi
+
 for lib in ../lib/*
 do
        name=`basename $lib`
 for lib in ../lib/*
 do
        name=`basename $lib`
@@ -86,40 +98,31 @@ do
        name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'`
 
        desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@"
        name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'`
 
        desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@"
+       reqs=
+
        if test $name = $MAIN_LIBRARY ; then
        if test $name = $MAIN_LIBRARY ; then
-               reqs=$SUB_LIBRARY_REQ
                desc="$desc library"
        elif test $name = $SUB_LIBRARY ; then
                desc="$desc library"
        elif test $name = $SUB_LIBRARY ; then
-               reqs=
                desc="$desc terminal interface library"
        elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then
                desc="$desc terminal interface library"
        elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then
-               reqs="$PANEL_LIBRARY $MENU_LIBRARY $FORM_LIBRARY $MAIN_LIBRARY $SUB_LIBRARY_REQ"
+               reqs="$PANEL_LIBRARY, $MENU_LIBRARY, $FORM_LIBRARY, $MAIN_LIBRARY"
                desc="$desc add-on library"
        else
                desc="$desc add-on library"
        else
-               reqs="$MAIN_LIBRARY $SUB_LIBRARY_REQ"
+               reqs="$MAIN_LIBRARY"
                desc="$desc add-on library"
        fi
 
                desc="$desc add-on library"
        fi
 
-       if test "$includedir" = "/usr/include" ; then
-               cflags=
-       else
-               cflags="-I\${includedir}"
-       fi
-
-       if test "$libdir" = "/usr/lib" ; then
-               libs=
-       else
-               libs="-L\${libdir}"
-       fi
-       libs="$libs -l$name"
-
-       # add dependencies that pkg-config cannot guess about
-       if test -z "$reqs" ; then
-               libs="$libs @LIBS@"
+       if test $name != $SUB_LIBRARY ; then
+               if test $name != $TINFO_NAME ; then
+                       test -n "$reqs" && reqs="$reqs, "
+                       reqs="${reqs}${SUB_LIBRARY}"
+               fi
        fi
 
        echo "** creating ${name}.pc"
        cat >${name}.pc <<EOF
        fi
 
        echo "** creating ${name}.pc"
        cat >${name}.pc <<EOF
+# vile:makemode
+
 prefix=$show_prefix
 exec_prefix=$show_exec_prefix
 libdir=$show_libdir
 prefix=$show_prefix
 exec_prefix=$show_exec_prefix
 libdir=$show_libdir
@@ -130,10 +133,13 @@ version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
 Name: $name
 Description: $desc
 Version: \${version}
 Name: $name
 Description: $desc
 Version: \${version}
-Requires: $reqs
-Libs: $libs
-Cflags: $cflags
+URL: http://invisible-island.net/ncurses
+Requires.private: $reqs
+Libs: $LDFLAGS -l$name
+Libs.private: @LIBS@
+Cflags: $CFLAGS
 EOF
 EOF
-       # pr -f ${name}.pc
+
+       #pr -f ${name}.pc
 done
 # vile:shmode
 done
 # vile:shmode
index 309c3e82a3fd75238376e0d26df8cf42fb8efc77..0d41aaacf653ae0a425564ff914631f3c9fb8c56 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.483 2011/09/17 19:08:20 tom Exp $
+ * $Id: curses.priv.h,v 1.485 2011/10/08 21:00:56 tom Exp $
  *
  *     curses.priv.h
  *
  *
  *     curses.priv.h
  *
@@ -784,6 +784,11 @@ struct DriverTCB; /* Terminal Control Block forward declaration */
 #define INIT_TERM_DRIVER()     /* nothing */
 #endif
 
 #define INIT_TERM_DRIVER()     /* nothing */
 #endif
 
+typedef struct {
+    const char *name;
+    char *value;
+} ITERATOR_VARS;
+
 /*
  * Global data which is not specific to a screen.
  */
 /*
  * Global data which is not specific to a screen.
  */
@@ -816,6 +821,12 @@ typedef struct {
        int             tgetent_index;
        long            tgetent_sequence;
 
        int             tgetent_index;
        long            tgetent_sequence;
 
+       char            *dbd_blob;      /* string-heap for dbd_list[] */
+       char            **dbd_list;     /* distinct places to look for data */
+       int             dbd_size;       /* length of dbd_list[] */
+       time_t          dbd_time;       /* cache last updated */
+       ITERATOR_VARS   dbd_vars[dbdLAST];
+
 #ifndef USE_SP_WINDOWLIST
        WINDOWLIST      *_nc_windowlist;
 #define WindowList(sp) _nc_globals._nc_windowlist
 #ifndef USE_SP_WINDOWLIST
        WINDOWLIST      *_nc_windowlist;
 #define WindowList(sp) _nc_globals._nc_windowlist
@@ -1945,6 +1956,7 @@ extern NCURSES_EXPORT(void) _nc_captoinfo_leaks(void);
 extern NCURSES_EXPORT(void) _nc_codes_leaks(void);
 extern NCURSES_EXPORT(void) _nc_comp_captab_leaks(void);
 extern NCURSES_EXPORT(void) _nc_comp_scan_leaks(void);
 extern NCURSES_EXPORT(void) _nc_codes_leaks(void);
 extern NCURSES_EXPORT(void) _nc_comp_captab_leaks(void);
 extern NCURSES_EXPORT(void) _nc_comp_scan_leaks(void);
+extern NCURSES_EXPORT(void) _nc_db_iterator_leaks(void);
 extern NCURSES_EXPORT(void) _nc_keyname_leaks(void);
 extern NCURSES_EXPORT(void) _nc_names_leaks(void);
 extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
 extern NCURSES_EXPORT(void) _nc_keyname_leaks(void);
 extern NCURSES_EXPORT(void) _nc_names_leaks(void);
 extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
index f7e4d6064bf30f020e79cee27fc1a3a1bf6324d5..35185855d734517bb31105b336b045b9f1c2c3e9 100644 (file)
 #include <hashed_db.h>
 #endif
 
 #include <hashed_db.h>
 #endif
 
-MODULE_ID("$Id: db_iterator.c,v 1.18 2011/09/26 09:52:00 tom Exp $")
+MODULE_ID("$Id: db_iterator.c,v 1.20 2011/10/08 20:55:38 tom Exp $")
 
 #define HaveTicDirectory _nc_globals.have_tic_directory
 #define KeepTicDirectory _nc_globals.keep_tic_directory
 #define TicDirectory     _nc_globals.tic_directory
 
 #define HaveTicDirectory _nc_globals.have_tic_directory
 #define KeepTicDirectory _nc_globals.keep_tic_directory
 #define TicDirectory     _nc_globals.tic_directory
-
-/*
- * FIXME: need a no-leaks entrypoint.
- */
-static char *my_blob;          /* string-heap for my_list[] */
-static char **my_list;         /* distinct places to look for data */
-static int my_size;            /* length of my_list[] */
-static time_t my_time;         /* cache last updated */
-static struct {
-    const char *name;
-    char *value;
-} my_vars[dbdLAST];
+#define my_blob          _nc_globals.dbd_blob
+#define my_list          _nc_globals.dbd_list
+#define my_size          _nc_globals.dbd_size
+#define my_time          _nc_globals.dbd_time
+#define my_vars          _nc_globals.dbd_vars
 
 static void
 add_to_blob(const char *text)
 
 static void
 add_to_blob(const char *text)
@@ -377,6 +370,18 @@ _nc_first_db(DBDIRS * state, int *offset)
            } else {
                FreeAndNull(my_blob);
            }
            } else {
                FreeAndNull(my_blob);
            }
+           free(my_stat);
        }
     }
 }
        }
     }
 }
+
+#if NO_LEAKS
+void
+_nc_db_iterator_leaks(void)
+{
+    if (my_blob != 0)
+       FreeAndNull(my_blob);
+    if (my_list != 0)
+       FreeAndNull(my_list);
+}
+#endif
index b1e14a803f313e452c5b314ab91e0610c5418d07..036a61b2b6aec1fc5d0db1ae3d1990be676bf9a9 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <tic.h>
 
 
 #include <tic.h>
 
-MODULE_ID("$Id: entries.c,v 1.17 2010/01/23 17:57:43 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.18 2011/10/08 20:32:26 tom Exp $")
 
 /****************************************************************************
  *
 
 /****************************************************************************
  *
@@ -128,6 +128,7 @@ _nc_leaks_tinfo(void)
     _nc_free_entries(_nc_head);
     _nc_get_type(0);
     _nc_first_name(0);
     _nc_free_entries(_nc_head);
     _nc_get_type(0);
     _nc_first_name(0);
+    _nc_db_iterator_leaks();
     _nc_keyname_leaks();
 #if BROKEN_LINKER || USE_REENTRANT
     _nc_names_leaks();
     _nc_keyname_leaks();
 #if BROKEN_LINKER || USE_REENTRANT
     _nc_names_leaks();
index 9b816b5a6408061e5aebab389f5cb0cc3f20ade5..c391135798d4d94650e57ab35d6791f543faf823 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 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            *
@@ -42,7 +42,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.62 2011/09/26 09:48:08 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.63 2011/10/08 21:03:29 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -142,6 +142,12 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
     0,                         /* tgetent_index */
     0,                         /* tgetent_sequence */
 
     0,                         /* tgetent_index */
     0,                         /* tgetent_sequence */
 
+    0,                         /* dbd_blob */
+    0,                         /* dbd_list */
+    0,                         /* dbd_size */
+    0,                         /* dbd_time */
+    { { 0, 0 } },              /* dbd_vars */
+
 #ifndef USE_SP_WINDOWLIST
     0,                         /* _nc_windowlist */
 #endif
 #ifndef USE_SP_WINDOWLIST
     0,                         /* _nc_windowlist */
 #endif
index 15c281def50c94746857e83fb70bb64209f0d07e..e050fe10d9460950b39f0b12c59e83ecd21dbca6 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 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            *
 
 #include <build.priv.h>
 
 
 #include <build.priv.h>
 
+#include <term_entry.h>
 #include <tic.h>
 #include <hashsize.h>
 
 #include <ctype.h>
 
 #include <tic.h>
 #include <hashsize.h>
 
 #include <ctype.h>
 
-MODULE_ID("$Id: make_hash.c,v 1.3 2010/05/22 18:02:50 tom Exp $")
+MODULE_ID("$Id: make_hash.c,v 1.4 2011/10/08 21:11:54 tom Exp $")
 
 /*
  *     _nc_make_hash_table()
 
 /*
  *     _nc_make_hash_table()