From f886673eef3bcbe8ca4472530cfd606332e30364 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 18 Aug 2013 00:20:29 +0000 Subject: [PATCH] ncurses 5.9 - patch 20130816 + add checks in tic to warn about terminals which lack cursor addressing, capabilities or having those, are marked as hard_copy or generic_type. + use --without-progs in mingw-ncurses rpm. + split out _nc_init_termtype() from alloc_entry.c to use in MinGW port when tic and other programs are not needed. --- NEWS | 10 ++++++- aclocal.m4 | 8 +++--- dist.mk | 4 +-- include/MKterm.h.awk.in | 3 +- ncurses/tinfo/alloc_entry.c | 34 ++++------------------ ncurses/tinfo/read_entry.c | 32 ++++++++++++++++++++- ncurses/win32con/win_driver.c | 4 +-- package/debian/changelog | 4 +-- package/mingw-ncurses.spec | 3 +- package/ncurses.spec | 2 +- progs/tic.c | 54 +++++++++++++++++++++++++++++++++-- 11 files changed, 112 insertions(+), 46 deletions(-) diff --git a/NEWS b/NEWS index 30f2c021..12f93357 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.2085 2013/08/05 00:51:45 tom Exp $ +-- $Id: NEWS,v 1.2089 2013/08/17 21:17:42 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. +20130816 + + add checks in tic to warn about terminals which lack cursor + addressing, capabilities or having those, are marked as hard_copy or + generic_type. + + use --without-progs in mingw-ncurses rpm. + + split out _nc_init_termtype() from alloc_entry.c to use in MinGW + port when tic and other programs are not needed. + 20130805 + minor fixes to the --disable-overwrite logic, to ensure that the configured $(includedir) is not cancelled by the mingwxx-filesystem diff --git a/aclocal.m4 b/aclocal.m4 index 4a9f2360..ca69d919 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.674 2013/08/03 22:18:08 tom Exp $ +dnl $Id: aclocal.m4,v 1.675 2013/08/17 18:43:56 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -3110,7 +3110,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 72 updated: 2013/03/24 17:10:41 +dnl CF_LIB_RULES version: 73 updated: 2013/08/03 18:18:08 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 @@ -5340,7 +5340,7 @@ CF_VERBOSE(...checked $1 [$]$1) AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 79 updated: 2013/07/27 17:57:16 +dnl CF_SHARED_OPTS version: 81 updated: 2013/08/03 18:18:08 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -5918,7 +5918,7 @@ if test "$cf_cv_sizechange" != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 26 updated: 2012/01/07 15:08:24 +dnl CF_SRC_MODULES version: 27 updated: 2013/08/03 18:18:08 dnl -------------- dnl For each parameter, test if the source-directory exists, and if it contains dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll diff --git a/dist.mk b/dist.mk index a1f840cb..ba3e315b 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.940 2013/08/05 00:52:17 tom Exp $ +# $Id: dist.mk,v 1.941 2013/08/17 17:15:43 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 = 20130805 +NCURSES_PATCH = 20130816 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in index c9419bc4..587ee521 100644 --- a/include/MKterm.h.awk.in +++ b/include/MKterm.h.awk.in @@ -34,7 +34,7 @@ BEGIN { print "/* and: Thomas E. Dickey 1995-on */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.61 2013/05/25 20:04:51 tom Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.62 2013/08/17 19:21:56 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" @@ -252,6 +252,7 @@ END { print "extern NCURSES_EXPORT(int) _nc_get_tty_mode (TTY *buf);" print "extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);" print "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);" + print "extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE *const);" print "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);" print "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);" print "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);" diff --git a/ncurses/tinfo/alloc_entry.c b/ncurses/tinfo/alloc_entry.c index 88edb0fa..14ea3911 100644 --- a/ncurses/tinfo/alloc_entry.c +++ b/ncurses/tinfo/alloc_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 * @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: alloc_entry.c,v 1.57 2012/10/27 21:32:23 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.58 2013/08/17 19:20:38 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 @@ -61,8 +61,6 @@ NCURSES_EXPORT(void) _nc_init_entry(TERMTYPE *const tp) /* initialize a terminal type data block */ { - unsigned i; - #if NO_LEAKS if (tp == 0) { if (stringbuf != 0) { @@ -75,31 +73,9 @@ _nc_init_entry(TERMTYPE *const tp) if (stringbuf == 0) TYPE_MALLOC(char, (size_t) MAX_STRTAB, stringbuf); -#if NCURSES_XNAMES - tp->num_Booleans = BOOLCOUNT; - tp->num_Numbers = NUMCOUNT; - tp->num_Strings = STRCOUNT; - tp->ext_Booleans = 0; - tp->ext_Numbers = 0; - tp->ext_Strings = 0; -#endif - if (tp->Booleans == 0) - TYPE_MALLOC(NCURSES_SBOOL, BOOLCOUNT, tp->Booleans); - if (tp->Numbers == 0) - TYPE_MALLOC(short, NUMCOUNT, tp->Numbers); - if (tp->Strings == 0) - TYPE_MALLOC(char *, STRCOUNT, tp->Strings); - - for_each_boolean(i, tp) - tp->Booleans[i] = FALSE; - - for_each_number(i, tp) - tp->Numbers[i] = ABSENT_NUMERIC; - - for_each_string(i, tp) - tp->Strings[i] = ABSENT_STRING; - next_free = 0; + + _nc_init_termtype(tp); } NCURSES_EXPORT(ENTRY *) @@ -137,7 +113,7 @@ _nc_save_str(const char *const string) next_free += len; result = (stringbuf + old_next_free); } else { - _nc_warning("Too much data, some is lost"); + _nc_warning("Too much data, some is lost: %s", string); } return result; } diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index 4d1cb116..0c825d53 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: read_entry.c,v 1.124 2013/07/13 20:06:43 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.125 2013/08/17 19:06:59 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -115,6 +115,36 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) #define even_boundary(value) \ if ((value) % 2 != 0) Read(buf, 1) +NCURSES_EXPORT(void) +_nc_init_termtype(TERMTYPE *const tp) +{ + unsigned i; + +#if NCURSES_XNAMES + tp->num_Booleans = BOOLCOUNT; + tp->num_Numbers = NUMCOUNT; + tp->num_Strings = STRCOUNT; + tp->ext_Booleans = 0; + tp->ext_Numbers = 0; + tp->ext_Strings = 0; +#endif + if (tp->Booleans == 0) + TYPE_MALLOC(NCURSES_SBOOL, BOOLCOUNT, tp->Booleans); + if (tp->Numbers == 0) + TYPE_MALLOC(short, NUMCOUNT, tp->Numbers); + if (tp->Strings == 0) + TYPE_MALLOC(char *, STRCOUNT, tp->Strings); + + for_each_boolean(i, tp) + tp->Booleans[i] = FALSE; + + for_each_number(i, tp) + tp->Numbers[i] = ABSENT_NUMERIC; + + for_each_string(i, tp) + tp->Strings[i] = ABSENT_STRING; +} + /* * Return TGETENT_YES if read, TGETENT_NO if not found or garbled. */ diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c index 6feb1660..d3660d24 100644 --- a/ncurses/win32con/win_driver.c +++ b/ncurses/win32con/win_driver.c @@ -38,7 +38,7 @@ #include #define CUR my_term.type. -MODULE_ID("$Id: win_driver.c,v 1.19 2013/05/25 20:16:46 tom Exp $") +MODULE_ID("$Id: win_driver.c,v 1.20 2013/08/17 19:25:30 tom Exp $") #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) @@ -492,7 +492,7 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, if (code) { if ((TCB->term.type.Booleans) == 0) { - _nc_init_entry(&(TCB->term.type)); + _nc_init_termtype(&(TCB->term.type)); } } diff --git a/package/debian/changelog b/package/debian/changelog index b5b02d0a..3d2b8c3f 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20130805) unstable; urgency=low +ncurses6 (5.9-20130816) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 03 Aug 2013 13:17:35 -0400 + -- Thomas E. Dickey Sat, 17 Aug 2013 13:15:43 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index b4fcf8c0..ea75336d 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Release: 5.9 -Version: 20130805 +Version: 20130816 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz @@ -70,6 +70,7 @@ This package is used for testing ABI 6 with cross-compiles to MinGW. --without-debug \\\ --with-install-prefix=$RPM_BUILD_ROOT \\\ --without-manpages \\\ + --without-progs \\\ --without-tests %define debug_package %{nil} diff --git a/package/ncurses.spec b/package/ncurses.spec index 03627f26..0b7cf27b 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Release: 5.9 -Version: 20130805 +Version: 20130816 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz diff --git a/progs/tic.c b/progs/tic.c index 4d265eb1..e1eb7e09 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -46,7 +46,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.186 2013/06/08 16:50:47 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.187 2013/08/17 21:15:15 tom Exp $") #define STDIN_NAME "" @@ -1224,6 +1224,19 @@ check_ansi_cursor(char *list[4]) } #define EXPECTED(name) if (!PRESENT(name)) _nc_warning("expected " #name) +#define UNEXPECTED(name) if (PRESENT(name)) _nc_warning("unexpected " #name ", for %s", why) + +static void +check_noaddress(TERMTYPE *tp, const char *why) +{ + UNEXPECTED(column_address); + UNEXPECTED(cursor_address); + UNEXPECTED(cursor_home); + UNEXPECTED(cursor_mem_address); + UNEXPECTED(cursor_to_ll); + UNEXPECTED(row_address); + UNEXPECTED(row_address); +} static void check_cursor(TERMTYPE *tp) @@ -1231,6 +1244,43 @@ check_cursor(TERMTYPE *tp) int count; char *list[4]; + if (hard_copy) { + check_noaddress(tp, "hard_copy"); + } else if (generic_type) { + check_noaddress(tp, "generic_type"); + } else if (strchr(tp->term_names, '+') == 0) { + int y = 0; + int x = 0; + if (PRESENT(column_address)) + ++y; + if (PRESENT(cursor_address)) + y = x = 10; + if (PRESENT(cursor_home)) + ++y, ++x; + if (PRESENT(cursor_mem_address)) + y = x = 10; + if (PRESENT(cursor_to_ll)) + ++y, ++x; + if (PRESENT(row_address)) + ++x; + if (PRESENT(cursor_down)) + ++y; + if (PRESENT(cursor_up)) + ++y; + if (PRESENT(cursor_left)) + ++x; + if (PRESENT(cursor_right)) + ++x; + if (x < 2 && y < 2) { + _nc_warning("terminal lacks cursor addressing"); + } else { + if (x < 2) + _nc_warning("terminal lacks cursor column-addressing"); + if (y < 2) + _nc_warning("terminal lacks cursor row-addressing"); + } + } + /* it is rare to have an insert-line feature without a matching delete */ ANDMISSING(parm_insert_line, insert_line); ANDMISSING(parm_delete_line, delete_line); @@ -1412,7 +1462,7 @@ check_keypad(TERMTYPE *tp) /* * These warnings are useful for consistency checks - it is possible that - * there are real terminals with mismatches in these + * there are real terminals with mismatches in these */ ANDMISSING(key_ic, key_dc); } -- 2.45.0