ncurses 5.9 - patch 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).
This commit is contained in:
Thomas E. Dickey 2011-10-09 00:51:26 +00:00
parent af4c589f0c
commit 44a4147009
10 changed files with 107 additions and 68 deletions

9
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written -- -- sale, use or other dealings in this Software without prior written --
-- authorization. -- -- 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; Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information. 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 20111001
+ modify tic "-K" option to only set the strict-flag rather than force + 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 source-output. That allows the same flag to control the parser for

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written # # use or other dealings in this Software without prior written #
# authorization. # # 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. # Makefile for creating ncurses distributions.
# #
# This only needs to be used directly as a makefile by developers, but # 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. # These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5 NCURSES_MAJOR = 5
NCURSES_MINOR = 9 NCURSES_MINOR = 9
NCURSES_PATCH = 20111001 NCURSES_PATCH = 20111008
# We don't append the patch to the version, since this only applies to releases # We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View 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_USES 32
#define MAX_CROSSLINKS 16 #define MAX_CROSSLINKS 16

View 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 * tic.h - Global variables and structures for the terminfo
* compiler. * compiler.
*/ */
@ -315,23 +315,6 @@ extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent *
extern const char * _nc_progname; extern const char * _nc_progname;
/* db_iterator.c */ /* 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_next_db(DBDIRS *, int *);
extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *); extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *);
extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *); extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *);

View 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 # # Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), # # 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 # The complete configure script for ncurses is the ncurses5-config (or similar
# name, depending on the flavor, e.g., ncursesw5-config, ncurses6-config, etc). # 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= SUB_LIBRARY_REQ=
fi 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/* for lib in ../lib/*
do do
name=`basename $lib` name=`basename $lib`
@ -86,40 +98,31 @@ do
name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'` name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'`
desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" 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" desc="$desc library"
elif test $name = $SUB_LIBRARY ; then elif test $name = $SUB_LIBRARY ; then
reqs=
desc="$desc terminal interface library" desc="$desc terminal interface library"
elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then 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" desc="$desc add-on library"
else else
reqs="$MAIN_LIBRARY $SUB_LIBRARY_REQ" reqs="$MAIN_LIBRARY"
desc="$desc add-on library" desc="$desc add-on library"
fi fi
if test "$includedir" = "/usr/include" ; then if test $name != $SUB_LIBRARY ; then
cflags= if test $name != $TINFO_NAME ; then
else test -n "$reqs" && reqs="$reqs, "
cflags="-I\${includedir}" reqs="${reqs}${SUB_LIBRARY}"
fi 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@"
fi fi
echo "** creating ${name}.pc" echo "** creating ${name}.pc"
cat >${name}.pc <<EOF cat >${name}.pc <<EOF
# vile:makemode
prefix=$show_prefix prefix=$show_prefix
exec_prefix=$show_exec_prefix exec_prefix=$show_exec_prefix
libdir=$show_libdir libdir=$show_libdir
@ -130,10 +133,13 @@ version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
Name: $name Name: $name
Description: $desc Description: $desc
Version: \${version} Version: \${version}
Requires: $reqs URL: http://invisible-island.net/ncurses
Libs: $libs Requires.private: $reqs
Cflags: $cflags Libs: $LDFLAGS -l$name
Libs.private: @LIBS@
Cflags: $CFLAGS
EOF EOF
# pr -f ${name}.pc
#pr -f ${name}.pc
done done
# vile:shmode # vile:shmode

View 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 */ #define INIT_TERM_DRIVER() /* nothing */
#endif #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; int tgetent_index;
long tgetent_sequence; 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 #ifndef USE_SP_WINDOWLIST
WINDOWLIST *_nc_windowlist; WINDOWLIST *_nc_windowlist;
#define WindowList(sp) _nc_globals._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_codes_leaks(void);
extern NCURSES_EXPORT(void) _nc_comp_captab_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_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_keyname_leaks(void);
extern NCURSES_EXPORT(void) _nc_names_leaks(void); extern NCURSES_EXPORT(void) _nc_names_leaks(void);
extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void); extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);

View File

@ -43,23 +43,16 @@
#include <hashed_db.h> #include <hashed_db.h>
#endif #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 HaveTicDirectory _nc_globals.have_tic_directory
#define KeepTicDirectory _nc_globals.keep_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory
#define TicDirectory _nc_globals.tic_directory #define TicDirectory _nc_globals.tic_directory
#define my_blob _nc_globals.dbd_blob
/* #define my_list _nc_globals.dbd_list
* FIXME: need a no-leaks entrypoint. #define my_size _nc_globals.dbd_size
*/ #define my_time _nc_globals.dbd_time
static char *my_blob; /* string-heap for my_list[] */ #define my_vars _nc_globals.dbd_vars
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];
static void static void
add_to_blob(const char *text) add_to_blob(const char *text)
@ -377,6 +370,18 @@ _nc_first_db(DBDIRS * state, int *offset)
} else { } else {
FreeAndNull(my_blob); 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

View 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_free_entries(_nc_head);
_nc_get_type(0); _nc_get_type(0);
_nc_first_name(0); _nc_first_name(0);
_nc_db_iterator_leaks();
_nc_keyname_leaks(); _nc_keyname_leaks();
#if BROKEN_LINKER || USE_REENTRANT #if BROKEN_LINKER || USE_REENTRANT
_nc_names_leaks(); _nc_names_leaks();

View 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 * * Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the * * 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_index */
0, /* tgetent_sequence */ 0, /* tgetent_sequence */
0, /* dbd_blob */
0, /* dbd_list */
0, /* dbd_size */
0, /* dbd_time */
{ { 0, 0 } }, /* dbd_vars */
#ifndef USE_SP_WINDOWLIST #ifndef USE_SP_WINDOWLIST
0, /* _nc_windowlist */ 0, /* _nc_windowlist */
#endif #endif

View 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 * * Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the * * copy of this software and associated documentation files (the *
@ -39,12 +39,13 @@
#include <build.priv.h> #include <build.priv.h>
#include <term_entry.h>
#include <tic.h> #include <tic.h>
#include <hashsize.h> #include <hashsize.h>
#include <ctype.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()