]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20091114
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 15 Nov 2009 02:00:17 +0000 (02:00 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 15 Nov 2009 02:00:17 +0000 (02:00 +0000)
+ 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).

NEWS
dist.mk
man/curs_trace.3x
ncurses/base/lib_newwin.c
ncurses/tinfo/MKcaptab.sh

diff --git a/NEWS b/NEWS
index 360bc09433bf49698c0ee2daccf7b8ee8421480d..47cc5ee2b88f725084990adf75f6073ab5a6b823 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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.
diff --git a/dist.mk b/dist.mk
index 400104dcb1b917a22cd80c3e203a7533feb296a9..e95d21793a826a69598109b827f9d9f952c958a2 100644 (file)
--- 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.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)
index ca7495272d330d51af7f793f152149a67d0cbe3a..a35f2693b47134535c166e0c378f24fc8d956f17 100644 (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,
 .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.
index 16d70db3936fe7baaa185e023847b7e61bc488a5..6632c77a0668af87fa8ac0a11a7d37fff2156872 100644 (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);
     }
 
index d333301a0b377eeded747bb76f80f8c3fcec4b92..5b8c4bcd0075e6e96964e0885ea1d5882416eabf 100755 (executable)
@@ -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}
@@ -55,7 +55,7 @@ EOF
 ./make_hash 1 info $OPT1 <$DATA
 ./make_hash 3 cap  $OPT1 <$DATA
 
-$AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA 
+$AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA
 
 $AWK -f $OPT2 bigstrings=$OPT1 tablename=infoalias <$DATA
 
@@ -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);
 }
 
+#define TCAP_LEN 2             /* only 1- or 2-character names are used */
+
+static HashValue
+tcap_hash(const char *string)
+{
+    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_cap_names(const char *a, const char *b)
+compare_tcap_names(const char *a, const char *b)
 {
-    return !strncmp(a, b, 2);
+    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)