ncurses 5.6 - patch 20080920

+ fix shared-library rules for cygwin with tic- and tinfo-libraries.
+ fix a memory leak when failure to connect to GPM.
+ correct check for notimeout() in wgetch() (report on linux.redhat
  newsgroup by FurtiveBertie).
+ add an example warning-suppression file for valgrind,
  misc/ncurses.supp (based on example from Reuben Thomas)
This commit is contained in:
Thomas E. Dickey 2008-09-21 01:01:25 +00:00
parent d736364fc0
commit 1c2ec25b81
10 changed files with 291 additions and 39 deletions

View File

@ -703,6 +703,7 @@
./misc/ncurses-config.in
./misc/ncurses.def
./misc/ncurses.ref
./misc/ncurses.supp
./misc/panel.def
./misc/panel.ref
./misc/run_tic.in

10
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.1289 2008/09/08 20:31:19 tom Exp $
-- $Id: NEWS,v 1.1296 2008/09/20 21:45:57 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.
20080920
+ fix shared-library rules for cygwin with tic- and tinfo-libraries.
+ fix a memory leak when failure to connect to GPM.
+ correct check for notimeout() in wgetch() (report on linux.redhat
newsgroup by FurtiveBertie).
+ add an example warning-suppression file for valgrind,
misc/ncurses.supp (based on example from Reuben Thomas)
20080913
+ change shared-library configuration for OpenBSD, make rpath work.
+ build-fixes for using libutf8, e.g., on OpenBSD 3.7

38
aclocal.m4 vendored
View File

@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: aclocal.m4,v 1.463 2008/09/13 16:54:28 tom Exp $
dnl $Id: aclocal.m4,v 1.465 2008/09/20 23:52:48 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -2076,7 +2076,7 @@ ifelse($1,,,[$1=$LIB_PREFIX])
AC_SUBST(LIB_PREFIX)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_LIB_RULES version: 51 updated: 2008/09/13 11:34:16
dnl CF_LIB_RULES version: 53 updated: 2008/09/20 19:51:59
dnl ------------
dnl Append definitions and rules for the given models to the subdirectory
dnl Makefiles, and the recursion rule for the top-level Makefile. If the
@ -2093,6 +2093,12 @@ AC_DEFUN([CF_LIB_RULES],
[
CF_LIB_PREFIX(cf_prefix)
AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
if test $cf_cv_shlib_version = cygdll ; then
TINFO_NAME=$TINFO_ARG_SUFFIX
TINFO_SUFFIX=.dll
fi
for cf_dir in $SRC_SUBDIRS
do
if test ! -d $srcdir/$cf_dir ; then
@ -2145,7 +2151,8 @@ do
# use autodetected ${cf_prefix} for import lib and static lib, but
# use 'cyg' prefix for shared lib.
if test $cf_cv_shlib_version = cygdll ; then
LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}\${ABI_VERSION}.dll"
cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'`
LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}${cf_cygsuf}"
continue
fi
fi
@ -2155,24 +2162,28 @@ do
if test $cf_dir = ncurses ; then
cf_subsets="$LIB_SUBSETS"
cf_r_parts="$cf_subsets"
cf_liblist="$LIBS_TO_MAKE"
while test -n "$cf_r_parts"
do
cf_l_parts=`echo "$cf_r_parts" |sed -e 's/ .*$//'`
cf_r_parts=`echo "$cf_r_parts" |sed -e 's/^[[^ ]]* //'`
if test "$cf_l_parts" != "$cf_r_parts" ; then
cf_item=
case $cf_l_parts in #(vi
*termlib*) #(vi
cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
cf_item=`echo $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
;;
*ticlib*)
cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g`
cf_item=`echo $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g`
;;
*)
break
;;
esac
LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
if test -n "$cf_item"; then
LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
fi
else
break
fi
@ -2205,22 +2216,21 @@ do
if test $cf_dir = ncurses ; then
case $cf_subset in
*base*)
cf_libname=${cf_libname}$LIB_SUFFIX
;;
*termlib*)
cf_libname=$TINFO_LIB_SUFFIX
if test -n "${DFT_ARG_SUFFIX}" ; then
# undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
fi
;;
ticlib*)
cf_libname=$TICS_LIB_SUFFIX
if test -n "${DFT_ARG_SUFFIX}" ; then
# undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
fi
;;
esac
else
cf_libname=${cf_libname}$LIB_SUFFIX
fi
if test -n "${DFT_ARG_SUFFIX}" ; then
# undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
fi
# These dependencies really are for development, not

33
configure vendored
View File

@ -17424,6 +17424,11 @@ done
esac
cf_prefix=$LIB_PREFIX
if test $cf_cv_shlib_version = cygdll ; then
TINFO_NAME=$TINFO_ARG_SUFFIX
TINFO_SUFFIX=.dll
fi
for cf_dir in $SRC_SUBDIRS
do
if test ! -d $srcdir/$cf_dir ; then
@ -17523,7 +17528,8 @@ do
# use autodetected ${cf_prefix} for import lib and static lib, but
# use 'cyg' prefix for shared lib.
if test $cf_cv_shlib_version = cygdll ; then
LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}\${ABI_VERSION}.dll"
cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'`
LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}${cf_cygsuf}"
continue
fi
fi
@ -17533,24 +17539,28 @@ do
if test $cf_dir = ncurses ; then
cf_subsets="$LIB_SUBSETS"
cf_r_parts="$cf_subsets"
cf_liblist="$LIBS_TO_MAKE"
while test -n "$cf_r_parts"
do
cf_l_parts=`echo "$cf_r_parts" |sed -e 's/ .*$//'`
cf_r_parts=`echo "$cf_r_parts" |sed -e 's/^[^ ]* //'`
if test "$cf_l_parts" != "$cf_r_parts" ; then
cf_item=
case $cf_l_parts in #(vi
*termlib*) #(vi
cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
cf_item=`echo $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
;;
*ticlib*)
cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g`
cf_item=`echo $cf_liblist |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g`
;;
*)
break
;;
esac
LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
if test -n "$cf_item"; then
LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
fi
else
break
fi
@ -17643,22 +17653,21 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ
if test $cf_dir = ncurses ; then
case $cf_subset in
*base*)
cf_libname=${cf_libname}$LIB_SUFFIX
;;
*termlib*)
cf_libname=$TINFO_LIB_SUFFIX
if test -n "${DFT_ARG_SUFFIX}" ; then
# undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
fi
;;
ticlib*)
cf_libname=$TICS_LIB_SUFFIX
if test -n "${DFT_ARG_SUFFIX}" ; then
# undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
fi
;;
esac
else
cf_libname=${cf_libname}$LIB_SUFFIX
fi
if test -n "${DFT_ARG_SUFFIX}" ; then
# undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
fi
# These dependencies really are for development, not

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.660 2008/09/08 19:46:14 tom Exp $
# $Id: dist.mk,v 1.661 2008/09/20 16:52:23 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 = 6
NCURSES_PATCH = 20080913
NCURSES_PATCH = 20080920
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

205
misc/ncurses.supp Normal file
View File

@ -0,0 +1,205 @@
# $Id: ncurses.supp,v 1.7 2008/09/20 18:43:42 tom Exp $
##############################################################################
# Copyright (c) 2008 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"), #
# to deal in the Software without restriction, including without limitation #
# the rights to use, copy, modify, merge, publish, distribute, distribute #
# with modifications, sublicense, and/or sell copies of the Software, and to #
# permit persons to whom the Software is furnished to do so, subject to the #
# following conditions: #
# #
# The above copyright notice and this permission notice shall be included in #
# all copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
# DEALINGS IN THE SOFTWARE. #
# #
# Except as contained in this notice, the name(s) of the above copyright #
# holders shall not be used in advertising or otherwise to promote the sale, #
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
#
# This is a warning-suppression file for valgrind and ncurses.
#
# ncurses can also be configured using the --disable-leaks option, which
# allows an application to call _nc_freeall() or _nc_free_and_exit(), to
# free all of ncurses' "permanent" memory.
#
# Some of these leaks can be freed if the application does its own cleanup,
# for example:
# delscreen(SP);
# del_curterm(cur_term);
# However, few applications do this.
{
ncurses_leak__nc_add_to_try
Memcheck:Leak
fun:*alloc
fun:_nc_add_to_try
}
{
ncurses_leak__nc_home_terminfo
Memcheck:Leak
fun:malloc
fun:_nc_home_terminfo
}
{
ncurses_leak__nc_init_wacs
Memcheck:Leak
fun:calloc
fun:_nc_init_wacs
}
{
ncurses_leak__nc_keyname
Memcheck:Leak
fun:calloc
fun:_nc_keyname
}
{
ncurses_leak__nc_keyname_2
Memcheck:Leak
fun:malloc
fun:strdup
fun:_nc_keyname
}
{
ncurses_leak__nc_printf_string
Memcheck:Leak
fun:malloc
fun:_nc_doalloc
fun:_nc_printf_string
}
{
ncurses_leak__nc_read_termtype
Memcheck:Leak
fun:*alloc
fun:_nc_read_termtype
fun:_nc_read_file_entry
}
{
ncurses_leak__nc_read_termtype_2
Memcheck:Leak
fun:*alloc
fun:_nc_doalloc
fun:_nc_read_termtype
fun:_nc_read_file_entry
}
{
ncurses_leak__nc_scroll_optimize
Memcheck:Leak
fun:*alloc
fun:_nc_hash_map
fun:_nc_scroll_optimize
}
{
ncurses_leak__nc_scroll_optimize_2
Memcheck:Leak
fun:*alloc
fun:_nc_doalloc
fun:_nc_scroll_optimize
}
{
ncurses_leak__nc_setupscreen
Memcheck:Leak
fun:calloc
fun:_nc_setupscreen
fun:newterm
}
{
ncurses_leak__nc_setupscreen_2
Memcheck:Leak
fun:calloc
fun:newwin
fun:_nc_setupscreen
}
{
ncurses_leak__nc_setupterm_1
Memcheck:Leak
fun:malloc
fun:strdup
fun:_nc_setupterm
}
{
ncurses_leak__nc_setupterm
Memcheck:Leak
fun:calloc
fun:_nc_setupterm
}
{
ncurses_leak__nc_setupscreen_3
Memcheck:Leak
fun:calloc
fun:_nc_makenew
fun:newwin
fun:_nc_setupscreen
}
{
ncurses_leak__nc_set_buffer
Memcheck:Leak
fun:malloc
fun:_nc_set_buffer
}
{
ncurses_leak__nc_tparm_analyze
Memcheck:Leak
fun:*alloc
fun:_nc_doalloc
fun:_nc_tparm_analyze
}
{
ncurses_leak__nc_trace_alloc
Memcheck:Leak
fun:*alloc
fun:_nc_doalloc
fun:_nc_trace_alloc
}
{
ncurses_leak_start_color
Memcheck:Leak
fun:calloc
fun:start_color
}
{
ncurses_leak_tparm
Memcheck:Leak
fun:realloc
fun:_nc_doalloc
fun:tparm
}
{
ncurses_leak_tparam_internal
Memcheck:Leak
fun:realloc
fun:_nc_doalloc
fun:get_space
fun:save_number
fun:tparam_internal
}

View File

@ -40,7 +40,7 @@
extern int malloc_errfd; /* FIXME */
#endif
MODULE_ID("$Id: lib_freeall.c,v 1.52 2008/08/31 00:50:36 tom Exp $")
MODULE_ID("$Id: lib_freeall.c,v 1.53 2008/09/20 18:28:51 tom Exp $")
/*
* Free all ncurses data. This is used for testing only (there's no practical
@ -142,4 +142,14 @@ NCURSES_EXPORT(void)
_nc_freeall(void)
{
}
NCURSES_EXPORT(void)
_nc_free_and_exit(int code)
{
if (SP)
delscreen(SP);
if (cur_term != 0)
del_curterm(cur_term);
exit(code);
}
#endif

View File

@ -41,7 +41,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_getch.c,v 1.98 2008/08/16 21:20:48 Werner.Fink Exp $")
MODULE_ID("$Id: lib_getch.c,v 1.99 2008/09/20 19:46:13 tom Exp $")
#include <fifo_defs.h>
@ -381,7 +381,7 @@ _nc_wgetch(WINDOW *win,
recur_wrefresh(win);
if (!win->_notimeout && (win->_delay >= 0 || sp->_cbreak > 1)) {
if (win->_notimeout || (win->_delay >= 0) || (sp->_cbreak > 1)) {
if (head == -1) { /* fifo is empty */
int delay;
int rc;

View File

@ -79,7 +79,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_mouse.c,v 1.97 2008/08/16 18:55:01 tom Exp $")
MODULE_ID("$Id: lib_mouse.c,v 1.98 2008/09/20 21:26:19 tom Exp $")
#include <term.h>
#include <tic.h>
@ -150,7 +150,7 @@ make an error
#define LIBGPM_SONAME "libgpm.so"
#endif
#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(obj, #name))
#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(SP->_dlopen_gpm, #name))
#endif /* USE_GPM_SUPPORT */
@ -415,6 +415,15 @@ enable_gpm_mouse(SCREEN *sp, int enable)
}
result = FALSE;
}
#ifdef HAVE_LIBDL
if (!result && (SP->_dlopen_gpm != 0)) {
T(("unload GPM library"));
SP->_mouse_gpm_found = FALSE;
SP->_mouse_gpm_loaded = FALSE;
dlclose(SP->_dlopen_gpm);
SP->_dlopen_gpm = 0;
}
#endif
returnBool(result);
}
#endif /* USE_GPM_SUPPORT */
@ -431,15 +440,13 @@ initialize_mousetype(SCREEN *sp)
if (allow_gpm_mouse()) {
if (!sp->_mouse_gpm_loaded) {
#ifdef HAVE_LIBDL
void *obj;
if ((obj = dlopen(LIBGPM_SONAME, my_RTLD)) != 0) {
if ((SP->_dlopen_gpm = dlopen(LIBGPM_SONAME, my_RTLD)) != 0) {
if (GET_DLSYM(gpm_fd) == 0 ||
GET_DLSYM(Gpm_Open) == 0 ||
GET_DLSYM(Gpm_Close) == 0 ||
GET_DLSYM(Gpm_GetEvent) == 0) {
T(("GPM initialization failed: %s", dlerror()));
dlclose(obj);
dlclose(SP->_dlopen_gpm);
} else {
sp->_mouse_gpm_found = TRUE;
}

View File

@ -34,7 +34,7 @@
/*
* $Id: curses.priv.h,v 1.390 2008/09/07 14:01:37 tom Exp $
* $Id: curses.priv.h,v 1.392 2008/09/20 21:14:11 tom Exp $
*
* curses.priv.h
*
@ -845,6 +845,7 @@ struct screen {
bool _mouse_gpm_loaded;
bool _mouse_gpm_found;
#ifdef HAVE_LIBDL
void *_dlopen_gpm;
TYPE_gpm_fd _mouse_gpm_fd;
TYPE_Gpm_Open _mouse_Gpm_Open;
TYPE_Gpm_Close _mouse_Gpm_Close;
@ -1592,6 +1593,7 @@ extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, bool, int);
extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
extern NCURSES_EXPORT(void) _nc_do_color (short, short, bool, int (*)(int));
extern NCURSES_EXPORT(void) _nc_flush (void);
extern NCURSES_EXPORT(void) _nc_free_and_exit (int);
extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE *);
extern NCURSES_EXPORT(void) _nc_freeall (void);
extern NCURSES_EXPORT(void) _nc_hash_map (void);