ncurses 5.7 - patch 20091114

+ updated man/curs_trace.3x
+ limit hashing for termcap-names to 2-characters (Ubuntu #481740).
+ change a variable name in lib_newwin.c to make it clearer which
  value is being freed on error (patch by Nicholas Marriott).
This commit is contained in:
Thomas E. Dickey 2009-11-15 02:00:17 +00:00
parent f5da57ad7e
commit f783dbd488
5 changed files with 62 additions and 16 deletions

8
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.1459 2009/11/07 22:13:22 tom Exp $
-- $Id: NEWS,v 1.1462 2009/11/14 22:32:45 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -45,6 +45,12 @@ 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.
20091114
+ updated man/curs_trace.3x
+ limit hashing for termcap-names to 2-characters (Ubuntu #481740).
+ change a variable name in lib_newwin.c to make it clearer which
value is being freed on error (patch by Nicholas Marriott).
20091107
+ improve test/ncurses.c color-cycling test by reusing attribute-
and color-cycling logic from the video-attributes screen.

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.730 2009/11/07 20:22:10 tom Exp $
# $Id: dist.mk,v 1.731 2009/11/14 00:58:56 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 = 7
NCURSES_PATCH = 20091107
NCURSES_PATCH = 20091114
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 2000-2005,2007 Free Software Foundation, Inc. *
.\" Copyright (c) 2000-2007,2009 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: curs_trace.3x,v 1.8 2007/02/24 17:33:49 tom Exp $
.\" $Id: curs_trace.3x,v 1.9 2009/11/14 22:32:19 tom Exp $
.TH curs_trace 3X ""
.na
.hy 0
@ -36,6 +36,8 @@
\fB_traceattr\fR,
\fB_traceattr2\fR,
\fB_nc_tracebits\fR,
\fB_tracecchar_t\fR,
\fB_tracecchar_t2\fR,
\fB_tracechar\fR,
\fB_tracechtype\fR,
\fB_tracechtype2\fR,
@ -56,7 +58,11 @@
.br
\fBchar *_nc_tracebits(void);\fR
.br
\fBchar *_tracechar(int);\fR
\fBchar * _tracecchar_t (const cchar_t *string);\fR
.br
\fBchar * _tracecchar_t2 (int buffer, const cchar_t *string);\fR
.br
\fBchar *_tracechar(int ch);\fR
.br
\fBchar *_tracechtype(chtype ch);\fR
.br
@ -71,6 +77,8 @@ as well as applications which use the ncurses libraries.
These functions are normally available only with the debugging library
\fIlibncurses_g.a\fR, but may be compiled into any model (shared, static,
profile) by defining the symbol \fBTRACE\fR.
Additionally, some functions are only available with the wide-character
configuration of the libraries.
.PP
The principal parts of this interface are the \fBtrace\fR routine which
selectively enables different tracing features, and the \fB_tracef\fR
@ -135,6 +143,21 @@ maximum trace level, enables all of the separate trace features.
Some tracing features are enabled whenever the \fBtrace\fR parameter
is nonzero. Some features overlap.
The specific names are used as a guideline.
.PP
These functions check the \fBNCURSES_TRACE\fP environment variable,
to set the tracing feature as if \fBtrace\fP was called:
.RS
filter,
initscr,
new_prescr,
newterm,
nofilter,
ripoffline,
setupterm,
slk_init,
tgetent
.RE
.SH RETURN VALUE
Routines which return a value are designed to be used as parameters
to the \fB_tracef\fR routine.

View File

@ -43,7 +43,7 @@
#include <curses.priv.h>
#include <stddef.h>
MODULE_ID("$Id: lib_newwin.c,v 1.64 2009/11/07 16:27:05 tom Exp $")
MODULE_ID("$Id: lib_newwin.c,v 1.65 2009/11/14 01:12:48 Nicholas.Marriott Exp $")
#define window_is(name) ((sp)->_##name == win)
@ -276,7 +276,7 @@ NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_DCLx
win = &(wp->win);
if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) {
free(win);
free(wp);
returnWin(0);
}

View File

@ -26,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: MKcaptab.sh,v 1.10 2009/08/08 17:19:25 tom Exp $
# $Id: MKcaptab.sh,v 1.12 2009/11/14 22:09:55 tom Exp $
AWK=${1-awk}
OPT1=${2-0}
OPT2=${3-tinfo/MKcaptab.awk}
@ -144,7 +144,7 @@ NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool termcap)
}
static HashValue
hash_function(const char *string)
info_hash(const char *string)
{
long sum = 0;
@ -158,10 +158,27 @@ hash_function(const char *string)
return (HashValue) (sum % HASHTABSIZE);
}
static int
compare_cap_names(const char *a, const char *b)
#define TCAP_LEN 2 /* only 1- or 2-character names are used */
static HashValue
tcap_hash(const char *string)
{
return !strncmp(a, b, 2);
char temp[TCAP_LEN + 1];
int limit = 0;
while (*string) {
temp[limit++] = *string++;
if (limit >= TCAP_LEN)
break;
}
temp[limit] = '\0';
return info_hash(temp);
}
static int
compare_tcap_names(const char *a, const char *b)
{
return !strncmp(a, b, TCAP_LEN);
}
static int
@ -171,8 +188,8 @@ compare_info_names(const char *a, const char *b)
}
static const HashData hash_data[2] = {
{ HASHTABSIZE, _nc_info_hash_table, hash_function, compare_info_names },
{ HASHTABSIZE, _nc_cap_hash_table, hash_function, compare_cap_names }
{ HASHTABSIZE, _nc_info_hash_table, info_hash, compare_info_names },
{ HASHTABSIZE, _nc_cap_hash_table, tcap_hash, compare_tcap_names }
};
NCURSES_EXPORT(const HashData *) _nc_get_hash_info (bool termcap)