From 6434e809cb70f93cc76d0f833e74447e32c99f54 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 19 Oct 2014 02:16:50 +0000 Subject: [PATCH 1/1] ncurses 5.9 - patch 20141018 + reviewed terminology 0.6.1, add function key definitions. None of the vt100-compatibility issues were improved -TD + improve infocmp conversion of extended capabilities to termcap by correcting the limit check against parametrized[], as well as filling in a check if the string happens to have parameters, e.g., "xm" in recent changes. + add check for zero/negative dimensions for resizeterm and resize_term (report by Mike Gran). --- NEWS | 12 +++++++++++- dist.mk | 4 ++-- misc/terminfo.src | 23 ++++++++++++++++------- ncurses/base/lib_mouse.c | 13 +++++++------ ncurses/base/resizeterm.c | 6 +++--- package/debian-mingw/changelog | 4 ++-- package/debian-mingw64/changelog | 4 ++-- package/debian/changelog | 4 ++-- package/mingw-ncurses.nsi | 4 ++-- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- progs/dump_entry.c | 15 +++++++++------ progs/dump_entry.h | 5 +++-- progs/tic.c | 11 +++++++---- 14 files changed, 68 insertions(+), 41 deletions(-) diff --git a/NEWS b/NEWS index f89cbee1..e3828f28 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.2287 2014/10/11 17:49:17 tom Exp $ +-- $Id: NEWS,v 1.2291 2014/10/19 01:19:36 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,16 @@ 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. +20141018 + + reviewed terminology 0.6.1, add function key definitions. None of + the vt100-compatibility issues were improved -TD + + improve infocmp conversion of extended capabilities to termcap by + correcting the limit check against parametrized[], as well as filling + in a check if the string happens to have parameters, e.g., "xm" + in recent changes. + + add check for zero/negative dimensions for resizeterm and resize_term + (report by Mike Gran). + 20141011 + add experimental support for xterm's 1005 mouse mode, to use in a demonstration of its limitations. diff --git a/dist.mk b/dist.mk index edf97eb8..f6ce09b9 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.1010 2014/10/09 01:02:28 tom Exp $ +# $Id: dist.mk,v 1.1011 2014/10/13 08:53:05 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 = 20141011 +NCURSES_PATCH = 20141018 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/misc/terminfo.src b/misc/terminfo.src index 903f2412..a9d4225f 100644 --- a/misc/terminfo.src +++ b/misc/terminfo.src @@ -6,8 +6,8 @@ # Report bugs and new terminal descriptions to # bug-ncurses@gnu.org # -# $Revision: 1.524 $ -# $Date: 2014/10/11 23:02:12 $ +# $Revision: 1.525 $ +# $Date: 2014/10/19 01:16:56 $ # # The original header is preserved below for reference. It is noted that there # is a "newer" version which differs in some cosmetic details (but actually @@ -5702,7 +5702,7 @@ terminator|Terminator no line wrap, #### TERMINOLOGY # http://enlightenment.org # -# Tested terminology-0.3.0, using tack and vttest. This is not a vt100 +# Tested terminology-0.3.0, 0.6.1, using tack and vttest. This is not a vt100 # emulator, nor is it compatible with xterm, but it uses a few features from # both -TD # @@ -5718,20 +5718,21 @@ terminator|Terminator no line wrap, # no blink # uses bce model for colors, but (see below) fails the vttest screens # has partial support for 256color feature. -# tack cursor-keys: +# tack function-keys (a subset of xterm+pcf0), and +# tack cursor-keys (a subset of xterm+pce2): # ctrl+shift (ignored) # 2 shift # shift-alt modifier -> shift (2) # 3 alt # 4 # 5 ctrl -# tack modifiers do not work for fkeys +# tack modifiers did not work for fkeys in 0.3.0; subset works in 0.6.1 # ctrl + khome/kend works - none of the other modifiers do # vttest - # spits lots of messages from termptyesc.c especially in vttest. # no 132-column mode # fails menu 1, 2 (definitely not vt100-compatible) -# primary and +# primary (claims vt420 with several options, apparently none work) and # secondary report says (perhaps... vt420): \E[>41;285;0c # CHA, HPR, VPA, CNL, CPL work # BCE with ED/EL - fail @@ -5742,6 +5743,10 @@ terminator|Terminator no line wrap, # X10 and Normal mouse work # Any-event mouse works # Mouse button-event works +# +# This description uses xterm+pcf0, which is misleading because the program +# does not handle combinations of modifiers - but listing them all would +# involve more effort than its developers spent -TD terminology|EFL-based terminal emulator, mc5i@, xon@, blink@, ed@, el@, el1@, invis=\E[8m, kLFT=\E[1;2D, @@ -5756,7 +5761,7 @@ terminology|EFL-based terminal emulator, kLFT3=\E[1;3D, kLFT4=\E[1;4D, kLFT5=\E[1;5D, kLFT6=\E[1;6D, kLFT7=\E[1;7D, kRIT3=\E[1;3C, kRIT4=\E[1;4C, kRIT5=\E[1;5C, kRIT6=\E[1;6C, - kRIT7=\E[1;7C, kUP=\E[1;2A, use=vt100, + kRIT7=\E[1;7C, kUP=\E[1;2A, use=xterm+pcf0, use=vt100, use=xterm+256setaf, ######## UNIX VIRTUAL TERMINALS, VIRTUAL CONSOLES, AND TELNET CLIENTS @@ -23564,4 +23569,8 @@ v3220|LANPAR Vision II model 3220/3221/3222, # 2014-10-11 # + add xterm-x10mouse, xterm-x11mouse, etc. -TD # +# 2014-10-18 +# + reviewed terminology 0.6.1, add function key definitions. None of +# the vt100-compatibility issues were improved -TD +# ######## SHANTIH! SHANTIH! SHANTIH! diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index cd46d0c9..1b3fa4e5 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -84,7 +84,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.162 2014/10/12 00:03:37 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.163 2014/10/18 10:32:02 tom Exp $") #include @@ -1097,7 +1097,7 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp) kbuf + grabbed, 1); if (res == -1) break; - grabbed += res; + grabbed += (size_t) res; if (grabbed > 1) { size_t check = 1; int n; @@ -1105,10 +1105,11 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp) for (n = 0; n < 2; ++n) { if (check >= grabbed) break; - rc = _nc_conv_to_utf32(&coords[n], kbuf + check, grabbed - check); + rc = _nc_conv_to_utf32(&coords[n], kbuf + check, (unsigned) + (grabbed - check)); if (!rc) break; - check += rc; + check += (size_t) rc; } if (n >= 2) break; @@ -1127,8 +1128,8 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp) result = decode_X10_bstate(sp, eventp, UChar(kbuf[0])); - eventp->x = (coords[0] - ' ') - 1; - eventp->y = (coords[1] - ' ') - 1; + eventp->x = (int) (coords[0] - ' ') - 1; + eventp->y = (int) (coords[1] - ' ') - 1; return result; } diff --git a/ncurses/base/resizeterm.c b/ncurses/base/resizeterm.c index 27e3e7f4..1eca2790 100644 --- a/ncurses/base/resizeterm.c +++ b/ncurses/base/resizeterm.c @@ -45,7 +45,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: resizeterm.c,v 1.46 2014/03/08 20:32:59 tom Exp $") +MODULE_ID("$Id: resizeterm.c,v 1.47 2014/10/13 08:56:49 tom Exp $") /* * If we're trying to be reentrant, do not want any local statics. @@ -347,7 +347,7 @@ NCURSES_SP_NAME(resize_term) (NCURSES_SP_DCLx int ToLines, int ToCols) (SP_PARM == 0) ? -1 : screen_lines(SP_PARM), (SP_PARM == 0) ? -1 : screen_columns(SP_PARM))); - if (SP_PARM == 0) { + if (SP_PARM == 0 || ToLines <= 0 || ToCols <= 0) { returnCode(ERR); } @@ -466,7 +466,7 @@ NCURSES_SP_NAME(resizeterm) (NCURSES_SP_DCLx int ToLines, int ToCols) (SP_PARM == 0) ? -1 : screen_lines(SP_PARM), (SP_PARM == 0) ? -1 : screen_columns(SP_PARM))); - if (SP_PARM != 0) { + if (SP_PARM != 0 && ToLines > 0 && ToCols > 0) { result = OK; SP_PARM->_sig_winch = FALSE; diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 5f35b73d..81d8caca 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20141011) unstable; urgency=low +ncurses6 (5.9-20141018) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Wed, 08 Oct 2014 21:02:28 -0400 + -- Thomas E. Dickey Mon, 13 Oct 2014 04:53:05 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 5f35b73d..81d8caca 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20141011) unstable; urgency=low +ncurses6 (5.9-20141018) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Wed, 08 Oct 2014 21:02:28 -0400 + -- Thomas E. Dickey Mon, 13 Oct 2014 04:53:05 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index c3c86813..e7542d44 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20141011) unstable; urgency=low +ncurses6 (5.9-20141018) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Wed, 08 Oct 2014 21:02:28 -0400 + -- Thomas E. Dickey Mon, 13 Oct 2014 04:53:05 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 6843c40f..cbff7e38 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.65 2014/10/09 01:02:28 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.66 2014/10/13 08:53:05 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "5" !define VERSION_MINOR "9" !define VERSION_YYYY "2014" -!define VERSION_MMDD "1011" +!define VERSION_MMDD "1018" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 21108cfc..300e6848 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 5.9 -Release: 20141011 +Release: 20141018 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 83035483..49583850 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 5.9 -Release: 20141011 +Release: 20141018 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/progs/dump_entry.c b/progs/dump_entry.c index 65de9f9b..0f6a8b05 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 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 * @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.111 2013/12/15 01:05:20 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.114 2014/10/18 09:32:54 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -470,7 +470,7 @@ indent_DYN(DYNBUF * buffer, int level) strncpy_DYN(buffer, "\t", (size_t) 1); } -static bool +bool has_params(const char *src) { bool result = FALSE; @@ -791,10 +791,13 @@ fmt_entry(TERMTYPE *tterm, "%s@", name); WRAP_CONCAT; } else if (outform == F_TERMCAP || outform == F_TCONVERR) { - int params = ((i < (int) SIZEOF(parametrized)) - ? parametrized[i] - : 0); char *srccap = _nc_tic_expand(capability, TRUE, numbers); + int params = (((i < (int) SIZEOF(parametrized)) && + (i < STRCOUNT)) + ? parametrized[i] + : ((*srccap == 'k') + ? 0 + : has_params(srccap))); char *cv = _nc_infotocap(name, srccap, params); if (cv == 0) { diff --git a/progs/dump_entry.h b/progs/dump_entry.h index cb2a44fe..8b618089 100644 --- a/progs/dump_entry.h +++ b/progs/dump_entry.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 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 * @@ -33,7 +33,7 @@ ****************************************************************************/ /* - * $Id: dump_entry.h,v 1.33 2013/12/15 01:08:03 tom Exp $ + * $Id: dump_entry.h,v 1.34 2014/10/18 09:34:15 tom Exp $ * * Dump control definitions and variables */ @@ -67,6 +67,7 @@ typedef int (*PredFunc) (PredType, PredIdx); typedef void (*PredHook) (PredType, PredIdx, const char *); extern NCURSES_CONST char *nametrans(const char *); +extern bool has_params(const char *src); extern int fmt_entry(TERMTYPE *, PredFunc, int, int, int, int); extern int show_entry(void); extern void compare_entry(PredHook, TERMTYPE *, bool); diff --git a/progs/tic.c b/progs/tic.c index 618419c8..763c2b79 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -48,7 +48,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.207 2014/06/15 00:36:45 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.208 2014/10/18 09:34:29 tom Exp $") #define STDIN_NAME "" @@ -1891,12 +1891,15 @@ same_ti_tc(const char *ti, const char *tc, bool * embedded) * Check terminfo to termcap translation. */ static void -check_infotocap(TERMTYPE *tp, int i, char *value) +check_infotocap(TERMTYPE *tp, int i, const char *value) { const char *name = ExtStrname(tp, i, strnames); - int params = ((i < (int) SIZEOF(parametrized)) + int params = (((i < (int) SIZEOF(parametrized)) && + (i < STRCOUNT)) ? parametrized[i] - : 0); + : ((*value == 'k') + ? 0 + : has_params(value))); int to_char = 0; char *ti_value; char *tc_value; -- 2.44.0