From: Thomas E. Dickey Date: Sun, 24 Feb 2019 01:51:57 +0000 (+0000) Subject: ncurses 6.1 - patch 20190223 X-Git-Tag: v6.2~50 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=344194b55bff15ccedd626246a547de476b4d83c;hp=6b4f5830b7910188b532d661f79775306715f67e ncurses 6.1 - patch 20190223 + fix typo in adds200 -TD + add tic check for consistent alternate character set capabilities. + improve check in mvcur() to decide whether to use hard-tabs, using xt, tbc and hts as clues. + replace check in reset command for obsolete "pt" capability using tbc and hts capabilities as clues (report by Nicolas Marriott). --- diff --git a/NEWS b/NEWS index 130758db..5aac7b72 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.3275 2019/02/16 23:45:57 tom Exp $ +-- $Id: NEWS,v 1.3278 2019/02/23 22:52:48 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. +20190223 + + fix typo in adds200 -TD + + add tic check for consistent alternate character set capabilities. + + improve check in mvcur() to decide whether to use hard-tabs, using + xt, tbc and hts as clues. + + replace check in reset command for obsolete "pt" capability using + tbc and hts capabilities as clues (report by Nicolas Marriott). + 20190216 + improve manual page description of TABSIZE. + add test/demo_tabs program. diff --git a/VERSION b/VERSION index c1cda65e..09faf76f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20190216 +5:0:10 6.1 20190223 diff --git a/dist.mk b/dist.mk index 636d49f3..e51afa36 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.1267 2019/02/13 22:19:33 tom Exp $ +# $Id: dist.mk,v 1.1268 2019/02/23 16:29:00 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 = 6 NCURSES_MINOR = 1 -NCURSES_PATCH = 20190216 +NCURSES_PATCH = 20190223 # 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 d147bfa8..d3d404c9 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.726 $ -# $Date: 2019/01/12 22:33:55 $ +# $Revision: 1.727 $ +# $Date: 2019/02/23 22:45:23 $ # # 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 @@ -14257,7 +14257,7 @@ regent60|regent200|adds200|Adds Regent 60, acsc=jLkDl@mHnhq`tXuTv\\wPxd, dch1=\EE, is2=\EV\EB, kbs=^H, kcbt=\EO, kdch1=\EE, kich1=\EF, krmir=\EF, rmacs=\E2, rmir=\EF, rmso=\ER\E0@\EV, smacs=\E1, smir=\EF, - smso=\ER\E0P\EV, cd=\Ek, kF1=^B!\r, kF2=^B"\r, kF3=^B#\r, + smso=\ER\E0P\EV, ed=\Ek, kF1=^B!\r, kF2=^B"\r, kF3=^B#\r, kF4=^B$\r, kF5=^B%\r, kF6=^B&\r, kF7=^B'\r, kF8=^B(\r, use=regent40+, # From: Thu Jul 9 09:27:33 1981 @@ -26010,4 +26010,7 @@ v3220|LANPAR Vision II model 3220/3221/3222, # + use SGR 1006 mouse for putty -TD # + add ti703/ti707, ti703-w/ti707-w (Robert Clausecker) # +# 2019-02-23 +# + fix typo in adds200 -TD +# ######## SHANTIH! SHANTIH! SHANTIH! diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 1ec7e73e..4807761c 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.615 2019/01/21 14:50:27 tom Exp $ + * $Id: curses.priv.h,v 1.616 2019/02/23 17:54:39 tom Exp $ * * curses.priv.h * @@ -539,6 +539,8 @@ NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *); #endif +#define HasHardTabs() (NonEmpty(clear_all_tabs) && NonEmpty(set_tab)) + #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \ __FILE__, __LINE__, \ (unsigned long) (pthread_self()), \ diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index cb9fd869..313d488a 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * + * Copyright (c) 1998-2018,2019 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 * @@ -159,7 +159,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.146 2018/03/03 22:40:47 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.148 2019/02/24 00:31:57 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -344,7 +344,9 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) SP_PARM->_home_cost = CostOf(cursor_home, 0); SP_PARM->_ll_cost = CostOf(cursor_to_ll, 0); #if USE_HARD_TABS - if (getenv("NCURSES_NO_HARD_TABS") == 0) { + if (getenv("NCURSES_NO_HARD_TABS") == 0 + && dest_tabs_magic_smso == 0 + && HasHardTabs()) { SP_PARM->_ht_cost = CostOf(tab, 0); SP_PARM->_cbt_cost = CostOf(back_tab, 0); } else { @@ -1217,24 +1219,21 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) if (fgets(buf, sizeof(buf), stdin) == 0) break; +#define PUTS(s) (void) puts(s) +#define PUTF(s,t) (void) printf(s,t) if (buf[0] == '?') { - (void) puts("? -- display this help message"); - (void) - puts("fy fx ty tx -- (4 numbers) display (fy,fx)->(ty,tx) move"); - (void) puts("s[croll] n t b m -- display scrolling sequence"); - (void) - printf("r[eload] -- reload terminal info for %s\n", - termname()); - (void) - puts("l[oad] -- load terminal info for type "); - (void) puts("d[elete] -- delete named capability"); - (void) puts("i[nspect] -- display terminal capabilities"); - (void) - puts("c[ost] -- dump cursor-optimization cost table"); - (void) puts("o[optimize] -- toggle movement optimization"); - (void) - puts("t[orture] -- torture-test with random moves"); - (void) puts("q[uit] -- quit the program"); + PUTS("? -- display this help message"); + PUTS("fy fx ty tx -- (4 numbers) display (fy,fx)->(ty,tx) move"); + PUTS("s[croll] n t b m -- display scrolling sequence"); + PUTF("r[eload] -- reload terminal info for %s\n", + termname()); + PUTS("l[oad] -- load terminal info for type "); + PUTS("d[elete] -- delete named capability"); + PUTS("i[nspect] -- display terminal capabilities"); + PUTS("c[ost] -- dump cursor-optimization cost table"); + PUTS("o[optimize] -- toggle movement optimization"); + PUTS("t[orture] -- torture-test with random moves"); + PUTS("q[uit] -- quit the program"); } else if (sscanf(buf, "%d %d %d %d", &fy, &fx, &ty, &tx) == 4) { struct timeval before, after; diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index f1b53834..0d99aee4 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190216) unstable; urgency=low +ncurses6 (6.1+20190223) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Wed, 13 Feb 2019 17:19:33 -0500 + -- Thomas E. Dickey Sat, 23 Feb 2019 11:29:00 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index f1b53834..0d99aee4 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190216) unstable; urgency=low +ncurses6 (6.1+20190223) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Wed, 13 Feb 2019 17:19:33 -0500 + -- Thomas E. Dickey Sat, 23 Feb 2019 11:29:00 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index f0ae539b..06a3a6f4 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190216) unstable; urgency=low +ncurses6 (6.1+20190223) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Wed, 13 Feb 2019 17:19:33 -0500 + -- Thomas E. Dickey Sat, 23 Feb 2019 11:29:00 -0500 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 9fabdcbb..ba50be5c 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.314 2019/02/13 22:19:33 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.315 2019/02/23 16:29:00 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "1" !define VERSION_YYYY "2019" -!define VERSION_MMDD "0216" +!define VERSION_MMDD "0223" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 11df0aa9..35354586 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: 6.1 -Release: 20190216 +Release: 20190223 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index b74ee1e1..77abab10 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.1 -Release: 20190216 +Release: 20190223 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index b699a9a9..99211220 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.1 -Release: 20190216 +Release: 20190223 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/progs/reset_cmd.c b/progs/reset_cmd.c index a4e44efc..058ebf9c 100644 --- a/progs/reset_cmd.c +++ b/progs/reset_cmd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 2016-2017,2019 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 * @@ -52,7 +52,7 @@ #include #endif -MODULE_ID("$Id: reset_cmd.c,v 1.13 2017/10/07 20:56:03 tom Exp $") +MODULE_ID("$Id: reset_cmd.c,v 1.14 2019/02/23 18:33:19 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -341,7 +341,7 @@ default_erase(void) int result; if (over_strike - && key_backspace != 0 + && VALID_STRING(key_backspace) && strlen(key_backspace) == 1) { result = key_backspace[0]; } else { @@ -398,7 +398,7 @@ set_conversions(TTY * tty_settings) #endif /* OXTABS */ /* test used to be tgetflag("NL") */ - if (newline != (char *) 0 && newline[0] == '\n' && !newline[1]) { + if (VALID_STRING(newline) && newline[0] == '\n' && !newline[1]) { /* Newline, not linefeed. */ #ifdef ONLCR tty_settings->c_oflag &= ~((unsigned) ONLCR); @@ -407,7 +407,7 @@ set_conversions(TTY * tty_settings) } #ifdef OXTABS /* test used to be tgetflag("pt") */ - if (has_hardware_tabs) /* Print tabs. */ + if (VALID_STRING(set_tab) && VALID_STRING(clear_all_tabs)) tty_settings->c_oflag &= ~OXTABS; #endif /* OXTABS */ tty_settings->c_lflag |= (ECHOE | ECHOK); @@ -423,7 +423,7 @@ set_conversions(TTY * tty_settings) static bool reset_tabstops(int wide) { - if ((init_tabs != 8) && (set_tab && clear_all_tabs)) { + if ((init_tabs != 8) && (VALID_STRING(set_tab) && VALID_STRING(clear_all_tabs))) { int c; (void) putc('\r', my_file); /* Force to left margin. */ @@ -449,7 +449,7 @@ static bool sent_string(const char *s) { bool sent = FALSE; - if (s != 0) { + if (VALID_STRING(s)) { tputs(s, 0, out_char); sent = TRUE; } @@ -474,7 +474,7 @@ send_init_strings(int fd GCC_UNUSED, TTY * old_settings) } #endif if (use_reset || use_init) { - if (init_prog != 0) { + if (VALID_STRING(init_prog)) { IGNORE_RC(system(init_prog)); } @@ -487,22 +487,22 @@ send_init_strings(int fd GCC_UNUSED, TTY * old_settings) : init_2string); #if defined(set_lr_margin) - if (set_lr_margin != 0) { + if (VALID_STRING(set_lr_margin)) { need_flush |= sent_string(TPARM_2(set_lr_margin, 0, columns - 1)); } else #endif #if defined(set_left_margin_parm) && defined(set_right_margin_parm) - if (set_left_margin_parm != 0 - && set_right_margin_parm != 0) { + if (VALID_STRING(set_left_margin_parm) + && VALID_STRING(set_right_margin_parm)) { need_flush |= sent_string(TPARM_1(set_left_margin_parm, 0)); need_flush |= sent_string(TPARM_1(set_right_margin_parm, columns - 1)); } else #endif - if (clear_margins != 0 - && set_left_margin != 0 - && set_right_margin != 0) { + if (VALID_STRING(clear_margins) + && VALID_STRING(set_left_margin) + && VALID_STRING(set_right_margin)) { need_flush |= sent_string(clear_margins); if (carriage_return != 0) { need_flush |= sent_string(carriage_return); @@ -510,7 +510,7 @@ send_init_strings(int fd GCC_UNUSED, TTY * old_settings) PUTCHAR('\r'); } need_flush |= sent_string(set_left_margin); - if (parm_right_cursor) { + if (VALID_STRING(parm_right_cursor)) { need_flush |= sent_string(TPARM_1(parm_right_cursor, columns - 1)); } else { @@ -519,7 +519,7 @@ send_init_strings(int fd GCC_UNUSED, TTY * old_settings) } } need_flush |= sent_string(set_right_margin); - if (carriage_return != 0) { + if (VALID_STRING(carriage_return)) { need_flush |= sent_string(carriage_return); } else { PUTCHAR('\r'); diff --git a/progs/tic.c b/progs/tic.c index 9efb4b03..705cac6c 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -48,7 +48,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.266 2019/02/10 02:25:46 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.268 2019/02/23 21:49:28 tom Exp $") #define STDIN_NAME "" @@ -1095,6 +1095,50 @@ main(int argc, char *argv[]) static void check_acs(TERMTYPE2 *tp) { + int vt100_smacs = 0; + int vt100_rmacs = 0; + int vt100_enacs = 0; + + /* + * ena_acs is not always necessary, but if it is present, the enter/exit + * capabilities should be. + */ + ANDMISSING(ena_acs, enter_alt_charset_mode); + ANDMISSING(ena_acs, exit_alt_charset_mode); + PAIRED(exit_alt_charset_mode, exit_alt_charset_mode); + + /* + * vt100-like is frequently used, but perhaps ena_acs is missing, etc. + */ + if (VALID_STRING(enter_alt_charset_mode)) { + vt100_smacs = (!strcmp("\033(0", enter_alt_charset_mode) + ? 2 + : (!strcmp("\016", enter_alt_charset_mode) + ? 1 + : 0)); + } + if (VALID_STRING(exit_alt_charset_mode)) { + vt100_rmacs = (!strcmp("\033(B", exit_alt_charset_mode) + ? 2 + : (!strcmp("\017", exit_alt_charset_mode) + ? 1 + : 0)); + } + if (VALID_STRING(ena_acs)) { + vt100_enacs = (!strcmp("\033(B\033)0", ena_acs) + ? 2 + : 0); + } + if (vt100_rmacs && vt100_smacs && (vt100_rmacs != vt100_smacs)) { + _nc_warning("rmacs/smacs are inconsistent"); + } + if ((vt100_rmacs == 2) && (vt100_smacs == 2) && vt100_enacs) { + _nc_warning("rmacs/smacs make enacs redundant"); + } + if ((vt100_rmacs == 1) && (vt100_smacs == 1) && !vt100_enacs) { + _nc_warning("VT100-style rmacs/smacs require enacs"); + } + if (VALID_STRING(acs_chars)) { const char *boxes = "lmkjtuvwqxn"; char mapped[256]; diff --git a/test/demo_tabs.c b/test/demo_tabs.c index 68023a32..51850e4c 100644 --- a/test/demo_tabs.c +++ b/test/demo_tabs.c @@ -29,10 +29,11 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_tabs.c,v 1.2 2019/02/17 01:01:11 tom Exp $ + * $Id: demo_tabs.c,v 1.4 2019/02/24 00:38:13 tom Exp $ * * A simple demo of tabs in curses. */ +#define USE_TINFO #include "test.priv.h" static void @@ -82,8 +83,10 @@ main(int argc, char *argv[]) cbreak(); if (curses_stops > 0) set_tabsize(curses_stops); +#if HAVE_TIGETNUM tabstop = tigetnum("it"); if (tabstop <= 0) +#endif tabstop = 8; for (row = 0; row < LINES; ++row) { move(row, 0);