diff --git a/NEWS b/NEWS index ad2572e8..9795fd68 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- 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 @@ -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. +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 diff --git a/dist.mk b/dist.mk index 9ba5fab1..e5ee9afe 100644 --- 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.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 @@ -37,7 +37,7 @@ SHELL = /bin/sh # 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) diff --git a/include/term_entry.h b/include/term_entry.h index bc715a7e..1074f167 100644 --- a/include/term_entry.h +++ b/include/term_entry.h @@ -32,7 +32,7 @@ * 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 @@ -47,6 +47,24 @@ extern "C" { #include +/* 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 diff --git a/include/tic.h b/include/tic.h index 94e60935..21749f9b 100644 --- a/include/tic.h +++ b/include/tic.h @@ -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. */ @@ -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 */ -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 *); diff --git a/misc/gen-pkgconfig.in b/misc/gen-pkgconfig.in index efd29105..c924bc63 100644 --- a/misc/gen-pkgconfig.in +++ b/misc/gen-pkgconfig.in @@ -1,7 +1,7 @@ #!@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"), # @@ -28,7 +28,7 @@ # 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). @@ -68,6 +68,18 @@ if test $TINFO_NAME = $LIB_NAME ; then 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` @@ -86,40 +98,31 @@ do name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'` desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" + reqs= + if test $name = $MAIN_LIBRARY ; then - reqs=$SUB_LIBRARY_REQ desc="$desc library" elif test $name = $SUB_LIBRARY ; then - reqs= 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 - reqs="$MAIN_LIBRARY $SUB_LIBRARY_REQ" + reqs="$MAIN_LIBRARY" 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 < #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 - -/* - * 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) @@ -377,6 +370,18 @@ _nc_first_db(DBDIRS * state, int *offset) } 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 diff --git a/ncurses/tinfo/entries.c b/ncurses/tinfo/entries.c index b1e14a80..036a61b2 100644 --- a/ncurses/tinfo/entries.c +++ b/ncurses/tinfo/entries.c @@ -37,7 +37,7 @@ #include -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_db_iterator_leaks(); _nc_keyname_leaks(); #if BROKEN_LINKER || USE_REENTRANT _nc_names_leaks(); diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index 9b816b5a..c3911357 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -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 * @@ -42,7 +42,7 @@ #include -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 @@ -142,6 +142,12 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 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 diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c index 15c281de..e050fe10 100644 --- a/ncurses/tinfo/make_hash.c +++ b/ncurses/tinfo/make_hash.c @@ -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 * @@ -39,12 +39,13 @@ #include +#include #include #include #include -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()