From: Thomas E. Dickey Date: Sun, 20 Jan 2013 01:59:01 +0000 (+0000) Subject: ncurses 5.9 - patch 20130119 X-Git-Tag: v6.0~119 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=4ceb04b5e19df8964f98c7675d9448c205a2053e ncurses 5.9 - patch 20130119 + fixes for issues found by Coverity: + fix memory leak in safe_sprintf.c + add check for return-value in tty_update.c + correct initialization for -s option in test/view.c + add check for numeric overflow in lib_instr.c + improve error-checking in copywin + add advice in infocmp manpage for termcap users (Debian #698469). + add "-y" option to test/demo_termcap and test/demo_terminfo to demonstrate behavior with/without extended capabilities. + updated termcap manpage to document legacy termcap behavior for matching capability names. + modify name-comparison for tgetstr, etc., to accommodate legacy applications as well as to improve compatbility with BSD 4.2 termcap implementations (Debian #698299) (cf: 980725). --- diff --git a/NEWS b/NEWS index 4988f4aa..aea89066 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.2010 2013/01/12 18:12:21 tom Exp $ +-- $Id: NEWS,v 1.2014 2013/01/20 01:05:06 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,22 @@ 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. +20130119 + + fixes for issues found by Coverity: + + fix memory leak in safe_sprintf.c + + add check for return-value in tty_update.c + + correct initialization for -s option in test/view.c + + add check for numeric overflow in lib_instr.c + + improve error-checking in copywin + + add advice in infocmp manpage for termcap users (Debian #698469). + + add "-y" option to test/demo_termcap and test/demo_terminfo to + demonstrate behavior with/without extended capabilities. + + updated termcap manpage to document legacy termcap behavior for + matching capability names. + + modify name-comparison for tgetstr, etc., to accommodate legacy + applications as well as to improve compatbility with BSD 4.2 + termcap implementations (Debian #698299) (cf: 980725). + 20130112 + correct prototype in manpage for vid_puts. + drop ncurses/tty/tty_display.h, ncurses/tty/tty_input.h, since they diff --git a/dist.mk b/dist.mk index f475f108..05855e4a 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.909 2013/01/12 14:34:58 tom Exp $ +# $Id: dist.mk,v 1.910 2013/01/19 13:54:45 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 = 20130112 +NCURSES_PATCH = 20130119 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/man/curs_termcap.3x b/man/curs_termcap.3x index a3b8bd8c..f8977beb 100644 --- a/man/curs_termcap.3x +++ b/man/curs_termcap.3x @@ -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 * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_termcap.3x,v 1.28 2012/11/03 21:56:15 tom Exp $ +.\" $Id: curs_termcap.3x,v 1.30 2013/01/19 15:58:48 tom Exp $ .TH curs_termcap 3X "" .de bP .IP \(bu 4 @@ -78,6 +78,7 @@ the \fItermcap\fR library. Their parameters are the same and the routines are emulated using the \fIterminfo\fR database. Thus, they can only be used to query the capabilities of entries for which a terminfo entry has been compiled. +.SS INITIALIZATION .PP The \fBtgetent\fR routine loads the entry for \fIname\fR. It returns: @@ -109,6 +110,7 @@ The \fItermcap\fP library does not check if the terminal description is marked with the \fIgeneric\fP capability, or if the terminal description has cursor-addressing. .RE +.SS CAPABILITY VALUES .PP The \fBtgetflag\fR routine gets the boolean entry for \fIid\fR, or zero if it is not available. @@ -127,12 +129,14 @@ Only the first two characters of the \fBid\fR parameter of \fBtgetflag\fR, \fBtgetnum\fR and \fBtgetstr\fR are compared in lookups. +.SS FORMATTING CAPABILITIES .PP The \fBtgoto\fR routine instantiates the parameters into the given capability. The output from this routine is to be passed to \fBtputs\fR. .PP The \fBtputs\fR routine is described on the \fBcurs_terminfo\fR(3X) manual page. It can retrieve capabilities by either termcap or terminfo name. +.SS GLOBAL VARIABLES .PP The variables \fBPC\fR, @@ -194,8 +198,28 @@ However, termcap applications' use of those variables is poorly documented, e.g., not distinguishing between input and output. In particular, some applications are reported to declare and/or modify \fBospeed\fR. +.PP +The comment that only the first two characters of the \fBid\fR parameter +are used escapes many application developers. +The original BSD 4.2 termcap library (and historical relics thereof) +did not require a trailing null NUL on the parameter name passed +to \fBtgetstr\fP, \fBtgetnum\fP and \fBtgetflag\fP. +Some applications assume that the termcap interface does not require +the trailing NUL for the parameter name. +Taking into account these issues: +.bP +As a special case, +\fBtgetflag\fP matched against a single-character identifier +provided that was at the end of the terminal description. +You should not rely upon this behavior in portable programs. +This implementation disallows matches against single-character capability names. +.bP +This implementation disallows matches by the termcap interface against +extended capability names which are longer than two characters. .SH SEE ALSO \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBterm_variables\fR(3X), \fBputc\fR(3). +.sp +http://invisible-island.net/ncurses/tctest.html diff --git a/man/infocmp.1m b/man/infocmp.1m index 601ba3be..3a0d1cad 100644 --- a/man/infocmp.1m +++ b/man/infocmp.1m @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" 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 * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: infocmp.1m,v 1.51 2012/05/26 21:32:01 tom Exp $ +.\" $Id: infocmp.1m,v 1.52 2013/01/19 21:23:07 tom Exp $ .TH @INFOCMP@ 1M "" .ds n 5 .ds d @TERMINFO@ @@ -131,6 +131,16 @@ parameterized information, and anything not converted will be plainly marked in the output and commented out. These should be edited by hand. .PP +For best results when converting to \fBtermcap\fP format, +you should use both \fB\-C\fP and \fB\-r\fP. +Normally a termcap description is limited to 1023 bytes. +@INFOCMP@ trims away less essential parts to make it fit. +If you are converting to one of the (rare) termcap implementations +which accept an unlimited size of termcap, +you may want to add the \fB\-T\fP option. +More often however, you must help the termcap implementation, +and trim excess whitespace (use the \fB\-0\fP option for that). +.PP All padding information for strings will be collected together and placed at the beginning of the string where \fBtermcap\fR expects it. Mandatory @@ -477,6 +487,8 @@ The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode. \fB@TOE@\fR(1M), \fBcurses\fR(3X), \fBterminfo\fR(\*n). +.sp +http://invisible-island.net/ncurses/tctest.html .PP This describes \fBncurses\fR version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@). diff --git a/ncurses/base/lib_instr.c b/ncurses/base/lib_instr.c index aadf8b43..5677b57b 100644 --- a/ncurses/base/lib_instr.c +++ b/ncurses/base/lib_instr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,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 * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: lib_instr.c,v 1.18 2011/10/22 16:31:35 tom Exp $") +MODULE_ID("$Id: lib_instr.c,v 1.20 2013/01/20 01:58:13 tom Exp $") NCURSES_EXPORT(int) winnstr(WINDOW *win, char *str, int n) @@ -80,9 +80,13 @@ winnstr(WINDOW *win, char *str, int n) init_mb(state); n3 = wcstombs(0, wch, (size_t) 0); if (!isEILSEQ(n3) && (n3 != 0)) { - if (((int) n3 + i) > n) { + size_t need = n3 + 10 + (size_t) i; + int have = (int) n3 + i; + + /* check for loop-done as well as overflow */ + if (have > n || (int) need <= 0) { done = TRUE; - } else if ((tmp = typeCalloc(char, n3 + 10)) == 0) { + } else if ((tmp = typeCalloc(char, need)) == 0) { done = TRUE; } else { init_mb(state); diff --git a/ncurses/base/lib_overlay.c b/ncurses/base/lib_overlay.c index bfb817bc..16591ac0 100644 --- a/ncurses/base/lib_overlay.c +++ b/ncurses/base/lib_overlay.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -40,7 +40,7 @@ #include -MODULE_ID("$Id: lib_overlay.c,v 1.29 2009/10/24 23:21:31 tom Exp $") +MODULE_ID("$Id: lib_overlay.c,v 1.30 2013/01/19 22:31:19 tom Exp $") static int overlap(const WINDOW *const src, WINDOW *const dst, int const flag) @@ -160,6 +160,7 @@ copywin(const WINDOW *src, WINDOW *dst, /* make sure rectangle exists in source */ if ((sminrow + dmaxrow - dminrow) <= (src->_maxy + 1) && (smincol + dmaxcol - dmincol) <= (src->_maxx + 1)) { + bool copied = FALSE; T(("rectangle exists in source")); @@ -172,10 +173,18 @@ copywin(const WINDOW *src, WINDOW *dst, dy <= dmaxrow; sy++, dy++) { + if (dy < 0 || sy < 0) + continue; + touched = FALSE; for (dx = dmincol, sx = smincol; dx <= dmaxcol; sx++, dx++) { + + if (dx < 0 || sx < 0) + continue; + copied = TRUE; + if (over) { if ((CharOf(src->_line[sy].text[sx]) != L(' ')) && (!CharEq(dst->_line[dy].text[dx], @@ -201,7 +210,8 @@ copywin(const WINDOW *src, WINDOW *dst, } } T(("finished copywin")); - rc = OK; + if (copied) + rc = OK; } } _nc_unlock_global(curses); diff --git a/ncurses/base/safe_sprintf.c b/ncurses/base/safe_sprintf.c index 9cea066c..34abd2f8 100644 --- a/ncurses/base/safe_sprintf.c +++ b/ncurses/base/safe_sprintf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,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 * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997 * + * Author: Thomas E. Dickey 1997-on * ****************************************************************************/ #include #include -MODULE_ID("$Id: safe_sprintf.c,v 1.26 2012/02/22 22:40:24 tom Exp $") +MODULE_ID("$Id: safe_sprintf.c,v 1.27 2013/01/20 01:04:32 tom Exp $") #if USE_SAFE_SPRINTF @@ -114,6 +114,7 @@ _nc_printf_length(const char *fmt, va_list ap) "%d", ival); fmt_len += strlen(fmt_arg); if ((format = _nc_doalloc(format, fmt_len)) == 0) { + free(buffer); return -1; } --f; diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index 5e743073..f6a0048b 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.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 * @@ -48,7 +48,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_termcap.c,v 1.78 2012/02/22 22:34:31 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.79 2013/01/19 18:20:05 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -63,6 +63,15 @@ NCURSES_EXPORT_VAR(char *) BC = 0; #define LAST_USE MyCache[CacheInx].last_used #define LAST_SEQ MyCache[CacheInx].sequence +/* + * Termcap names are matched only using the first two bytes. + * Ignore any extended names longer than two bytes, to avoid problems + * with legacy code which passes in parameters whose use is long forgotten. + */ +#define ValidCap(cap) (((cap)[0] != '\0') && ((cap)[1] != '\0')) +#define SameCap(a,b) (((a)[0] == (b)[0]) && ((a)[1] == (b)[1])) +#define ValidExt(ext) (ValidCap(ext) && (ext)[2] == '\0') + /*************************************************************************** * * tgetent(bufp, term) @@ -202,12 +211,13 @@ tgetent(char *bufp, const char *name) static bool same_tcname(const char *a, const char *b) { - fprintf(stderr, "compare(%s,%s)\n", a, b); - return !strncmp(a, b, (size_t) 2); + bool code = SameCap(a, b); + fprintf(stderr, "compare(%s,%s) %s\n", a, b, code ? "same" : "diff"); + return code; } #else -#define same_tcname(a,b) !strncmp(a, b, (size_t) 2) +#define same_tcname(a,b) SameCap(a,b) #endif /*************************************************************************** @@ -226,7 +236,7 @@ NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) int i, j; T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id)); - if (HasTInfoTerminal(SP_PARM)) { + if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); struct name_table_entry const *entry_ptr; @@ -239,7 +249,7 @@ NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) j = -1; for_each_ext_boolean(i, tp) { const char *capname = ExtBoolname(tp, i, boolcodes); - if (same_tcname(id, capname)) { + if (same_tcname(id, capname) && ValidExt(capname)) { j = i; break; } @@ -278,7 +288,7 @@ NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) int i, j; T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id)); - if (HasTInfoTerminal(SP_PARM)) { + if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); struct name_table_entry const *entry_ptr; @@ -291,7 +301,7 @@ NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) j = -1; for_each_ext_number(i, tp) { const char *capname = ExtNumname(tp, i, numcodes); - if (same_tcname(id, capname)) { + if (same_tcname(id, capname) && ValidExt(capname)) { j = i; break; } @@ -330,7 +340,7 @@ NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) int i, j; T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area)); - if (HasTInfoTerminal(SP_PARM)) { + if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) { TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); struct name_table_entry const *entry_ptr; @@ -343,7 +353,7 @@ NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) j = -1; for_each_ext_string(i, tp) { const char *capname = ExtStrname(tp, i, strcodes); - if (same_tcname(id, capname)) { + if (same_tcname(id, capname) && ValidExt(capname)) { j = i; break; } diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index e9ad6981..3253e549 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -82,7 +82,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.274 2013/01/12 17:24:22 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.275 2013/01/20 00:34:46 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -491,11 +491,12 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) return FALSE; if ((pair = GetPair(CHDEREF(ch))) != 0) { short fg, bg; - NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx - (short) pair, - &fg, &bg); - if (fg != C_MASK || bg != C_MASK) + if (NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, &bg) == ERR + || (fg != C_MASK || bg != C_MASK)) { return FALSE; + } } #else if (AttrOfD(ch) & A_COLOR) diff --git a/package/debian/changelog b/package/debian/changelog index 54a7f92b..940d8584 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20130112) unstable; urgency=low +ncurses6 (5.9-20130119) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 12 Jan 2013 10:00:42 -0500 + -- Thomas E. Dickey Sat, 19 Jan 2013 08:55:36 -0500 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/ncurses.spec b/package/ncurses.spec index e210d01f..e33e2a98 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: 20130112 +Version: 20130119 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz diff --git a/test/README b/test/README index cb660047..3850adb1 100644 --- a/test/README +++ b/test/README @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: README,v 1.46 2012/01/21 23:55:22 tom Exp $ +-- $Id: README,v 1.47 2013/01/19 21:30:38 tom Exp $ ------------------------------------------------------------------------------- The programs in this directory are designed to test your newest toy :-) @@ -223,11 +223,11 @@ PC lib: ncurses SP lib: form TABSIZE test: test_opaque UP - -acs_map test: gdc ins_wide inserts knight movewindow ncurses newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs +acs_map test: background gdc ins_wide inserts knight movewindow ncurses newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs add_wch test: demo_panels ncurses test_add_wchstr test_addwstr add_wchnstr test: test_add_wchstr add_wchstr test: test_add_wchstr view -addch test: blue bs echochar hashtest ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm +addch test: background blue bs echochar hashtest ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm addchnstr test: test_addchstr addchstr test: test_addchstr addnstr test: test_addstr @@ -271,7 +271,7 @@ color_content test: ncurses color_content_sp - color_set test: color_set ncurses copywin test: ncurses testcurs -cur_term test: demo_terminfo dots dots_mvcur lrtest progs: clear tabs tput tset +cur_term test: demo_terminfo dots dots_mvcur lrtest test_vid_puts test_vidputs progs: clear tabs tput tset curs_set test: echochar firework gdc hanoi lrtest ncurses newdemo rain savescreen tclock testcurs worm xmas curs_set_sp lib: ncurses curscr test: demo_panels edit_field knight lrtest ncurses savescreen tclock view @@ -306,7 +306,7 @@ erasechar_sp lib: ncurses erasewchar - filter test: filter filter_sp - -flash test: cardfile lrtest ncurses tclock testcurs +flash test: cardfile lrtest movewindow ncurses tclock testcurs flash_sp - flushinp test: ncurses newdemo testcurs flushinp_sp lib: ncurses @@ -399,7 +399,7 @@ key_defined_sp lib: ncurses key_name test: key_names ncurses keybound test: demo_altkeys demo_defkey keybound_sp lib: ncurses -keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw testcurs view progs: tic +keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw test_getstr testcurs view progs: tic keyname_sp lib: ncurses keyok test: demo_keyok foldkeys keyok_sp lib: ncurses @@ -430,7 +430,7 @@ mvaddstr test: bs demo_forms gdc hanoi knight ncurses rain tclock test_addstr mvaddwstr test: test_addwstr mvchgat test: chgat mvcur test: dots_mvcur redraw -mvcur_sp lib: ncurses +mvcur_sp - mvdelch - mvderwin test: movewindow mvget_wch - @@ -457,7 +457,7 @@ mvinsnstr test: inserts mvinsstr test: inserts mvinstr test: test_instr mvinwstr test: test_inwstr -mvprintw test: bs demo_menus firework hanoi ncurses tclock view +mvprintw test: background bs demo_menus firework hanoi ncurses tclock view mvscanw - mvvline test: ncurses mvvline_set test: ncurses @@ -542,13 +542,13 @@ pnoutrefresh test: edit_field ncurses prefresh test: testcurs printw test: background blue bs color_set demo_altkeys demo_defkey demo_keyok demo_menus filter foldkeys ncurses savescreen testcurs testscanw view putp progs: tput -putp_sp lib: ncurses +putp_sp - putwin test: ncurses qiflush - qiflush_sp - raw test: demo_forms ncurses redraw testcurs raw_sp lib: ncurses -redrawwin test: redraw +redrawwin test: redraw view refresh test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar filter firstlast gdc hanoi hashtest lrtest movewindow ncurses savescreen tclock testcurs view xmas reset_prog_mode test: filter ncurses reset_prog_mode_sp lib: ncurses @@ -586,7 +586,7 @@ set_tabsize_sp - set_term lib: ncurses setcchar test: demo_panels ins_wide ncurses test_add_wchstr test_addwstr view setscrreg test: view -setupterm test: demo_termcap demo_terminfo dots progs: clear tabs tput tset +setupterm test: demo_termcap demo_terminfo dots test_vid_puts test_vidputs progs: clear tabs tput tset slk_attr - slk_attr_off - slk_attr_on - @@ -644,20 +644,20 @@ tgetnum_sp - tgetstr test: demo_termcap railroad tgetstr_sp - tgoto test: railroad -tigetflag test: demo_terminfo progs: tput +tigetflag test: demo_terminfo progs: tic tput tigetflag_sp - tigetnum test: demo_terminfo ncurses progs: tput tigetnum_sp - -tigetstr test: blue demo_defkey demo_terminfo foldkeys testcurs progs: tput +tigetstr test: demo_defkey demo_terminfo foldkeys testcurs progs: tput tigetstr_sp - timeout test: rain savescreen tiparm - touchline test: chgat clip_printw insdelln touchwin test: chgat clip_printw demo_menus edit_field filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas tparm test: dots dots_mvcur progs: tabs tic tput -tputs test: dots dots_mvcur railroad progs: clear tabs tset +tputs test: dots dots_mvcur railroad test_vid_puts test_vidputs progs: clear tabs tset tputs_sp lib: ncurses -trace test: demo_menus hanoi hashtest lrtest ncurses testcurs view worm +trace test: demo_menus hashtest lrtest ncurses testcurs view worm ttytype lib: ncurses typeahead test: testcurs typeahead_sp lib: ncurses @@ -672,20 +672,22 @@ ungetmouse_sp - untouchwin lib: form use_default_colors test: background filter firework gdc hanoi knight ncurses rain tclock worm xmas use_default_colors_sp - -use_env progs: tput +use_env test: ncurses progs: tput use_env_sp - -use_extended_names test: demo_terminfo progs: infocmp tic +use_extended_names test: demo_termcap demo_terminfo progs: infocmp tic use_legacy_coding - use_legacy_coding_sp - use_screen test: ditto +use_tioctl test: ncurses +use_tioctl_sp - use_window test: rain worm -vid_attr - +vid_attr test: test_vid_puts vid_attr_sp - -vid_puts - +vid_puts test: test_vid_puts vid_puts_sp - -vidattr - -vidattr_sp lib: ncurses -vidputs - +vidattr test: test_vidputs +vidattr_sp - +vidputs test: test_vidputs vidputs_sp lib: ncurses vline test: gdc ncurses vline_set - diff --git a/test/demo_termcap.c b/test/demo_termcap.c index 6f9c80a9..50b56c5a 100644 --- a/test/demo_termcap.c +++ b/test/demo_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 2005-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 * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_termcap.c,v 1.22 2012/07/07 23:37:27 tom Exp $ + * $Id: demo_termcap.c,v 1.23 2013/01/19 19:30:52 tom Exp $ * * A simple demo of the termcap interface. */ @@ -337,6 +337,9 @@ usage(void) " -q quiet (prints only counts)", " -r COUNT repeat for given count", " -s print string-capabilities", +#ifdef NCURSES_VERSION + " -y disable extended capabilities", +#endif }; unsigned n; for (n = 0; n < SIZEOF(msg); ++n) { @@ -357,7 +360,7 @@ main(int argc, char *argv[]) int repeat; int r_opt = 1; - while ((n = getopt(argc, argv, "abd:e:nqr:s")) != -1) { + while ((n = getopt(argc, argv, "abd:e:nqr:sy")) != -1) { switch (n) { case 'a': a_opt = TRUE; @@ -384,6 +387,11 @@ main(int argc, char *argv[]) case 's': s_opt = TRUE; break; +#ifdef NCURSES_VERSION + case 'y': + use_extended_names(FALSE); + break; +#endif default: usage(); break; diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c index d9bf5540..28c79f96 100644 --- a/test/demo_terminfo.c +++ b/test/demo_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 2009-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 * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_terminfo.c,v 1.15 2012/12/29 23:36:22 tom Exp $ + * $Id: demo_terminfo.c,v 1.16 2013/01/19 19:30:58 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -325,6 +325,7 @@ usage(void) " -s print string-capabilities", #ifdef NCURSES_VERSION " -x print extended capabilities", + " -y disable extended capabilities", #endif }; unsigned n; @@ -341,8 +342,11 @@ main(int argc, char *argv[]) int repeat; char *name; int r_opt = 1; +#ifdef NCURSES_VERSION + bool xy_opt = TRUE; /* by default, use_extended_names is true */ +#endif - while ((n = getopt(argc, argv, "bd:e:fnqr:sx")) != -1) { + while ((n = getopt(argc, argv, "bd:e:fnqr:sxy")) != -1) { switch (n) { case 'b': b_opt = TRUE; @@ -372,7 +376,10 @@ main(int argc, char *argv[]) #ifdef NCURSES_VERSION case 'x': x_opt = TRUE; - use_extended_names(TRUE); + xy_opt = TRUE; + break; + case 'y': + xy_opt = FALSE; break; #endif default: @@ -381,6 +388,10 @@ main(int argc, char *argv[]) } } +#ifdef NCURSES_VERSION + use_extended_names(xy_opt); +#endif + if (!(b_opt || n_opt || s_opt || x_opt)) { b_opt = TRUE; n_opt = TRUE; diff --git a/test/view.c b/test/view.c index f775040a..865b4459 100644 --- a/test/view.c +++ b/test/view.c @@ -50,7 +50,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.91 2013/01/13 01:00:44 tom Exp $ + * $Id: view.c,v 1.92 2013/01/20 00:11:24 tom Exp $ */ #include @@ -233,7 +233,7 @@ main(int argc, char *argv[]) int value = 0; bool done = FALSE; bool got_number = FALSE; - bool single_step = TRUE; + bool single_step = FALSE; #if CAN_RESIZE bool nonposix_resize = FALSE; #endif