From 296420e1ec091e6dbd354cc13748638637690776 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sat, 25 May 2019 23:00:21 +0000 Subject: [PATCH 1/1] ncurses 6.1 - patch 20190525 + modify reset_cmd.c to allow for tabstops at intervals other than 8 (report by Vincent Huisman). --- NEWS | 6 ++- VERSION | 2 +- dist.mk | 4 +- man/tic.1m | 2 +- man/user_caps.5 | 4 +- 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 +- package/ncursest.spec | 2 +- progs/reset_cmd.c | 78 ++++++++++++++++---------------- 13 files changed, 62 insertions(+), 56 deletions(-) diff --git a/NEWS b/NEWS index ee18e84f..1c2f4306 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.3320 2019/05/19 00:12:03 tom Exp $ +-- $Id: NEWS,v 1.3322 2019/05/25 19:18:23 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,10 @@ 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. +20190525 + + modify reset_cmd.c to allow for tabstops at intervals other than 8 + (report by Vincent Huisman). + 20190518 + update xterm-new to xterm patch #345 -TD + add/use xterm+keypad in xterm-new (report by Alain D D Williams) -TD diff --git a/VERSION b/VERSION index 0a9b1d8f..8be7d044 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20190518 +5:0:10 6.1 20190525 diff --git a/dist.mk b/dist.mk index dfb0b249..b316322f 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.1283 2019/05/18 10:29:53 tom Exp $ +# $Id: dist.mk,v 1.1284 2019/05/25 15:39:25 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 = 20190518 +NCURSES_PATCH = 20190525 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/man/tic.1m b/man/tic.1m index a3b16917..5295b390 100644 --- a/man/tic.1m +++ b/man/tic.1m @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: tic.1m,v 1.68 2019/05/18 21:59:56 tom Exp $ +.\" $Id: tic.1m,v 1.69 2019/05/18 22:48:40 tom Exp $ .TH @TIC@ 1M "" .ie \n(.g .ds `` \(lq .el .ds `` `` diff --git a/man/user_caps.5 b/man/user_caps.5 index c90aee54..d819f729 100644 --- a/man/user_caps.5 +++ b/man/user_caps.5 @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2017,2018 Free Software Foundation, Inc. * +.\" Copyright (c) 2017-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 * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: user_caps.5,v 1.9 2018/07/28 22:05:23 tom Exp $ +.\" $Id: user_caps.5,v 1.10 2019/05/18 22:48:40 tom Exp $ .TH user_caps 5 .ie \n(.g .ds `` \(lq .el .ds `` `` diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index c91deceb..634dbd68 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190518) unstable; urgency=low +ncurses6 (6.1+20190525) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 18 May 2019 06:29:53 -0400 + -- Thomas E. Dickey Sat, 25 May 2019 11:39:25 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index c91deceb..634dbd68 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190518) unstable; urgency=low +ncurses6 (6.1+20190525) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 18 May 2019 06:29:53 -0400 + -- Thomas E. Dickey Sat, 25 May 2019 11:39:25 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 159f0079..f3c2c08b 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190518) unstable; urgency=low +ncurses6 (6.1+20190525) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 18 May 2019 06:29:53 -0400 + -- Thomas E. Dickey Sat, 25 May 2019 11:39:25 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 859c32e5..5fdfb1d6 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.329 2019/05/18 10:29:53 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.330 2019/05/25 15:39:25 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 "0518" +!define VERSION_MMDD "0525" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index c0fce342..8e91472a 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: 20190518 +Release: 20190525 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index fbb47bef..3dba222b 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: 20190518 +Release: 20190525 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index 12011909..eb96c649 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: 20190518 +Release: 20190525 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/progs/reset_cmd.c b/progs/reset_cmd.c index 058ebf9c..c5d96a2e 100644 --- a/progs/reset_cmd.c +++ b/progs/reset_cmd.c @@ -52,7 +52,7 @@ #include #endif -MODULE_ID("$Id: reset_cmd.c,v 1.14 2019/02/23 18:33:19 tom Exp $") +MODULE_ID("$Id: reset_cmd.c,v 1.17 2019/05/25 22:36:53 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -413,6 +413,28 @@ set_conversions(TTY * tty_settings) tty_settings->c_lflag |= (ECHOE | ECHOK); } +static bool +sent_string(const char *s) +{ + bool sent = FALSE; + if (VALID_STRING(s)) { + tputs(s, 0, out_char); + sent = TRUE; + } + return sent; +} + +static bool +to_left_margin(void) +{ + if (VALID_STRING(carriage_return)) { + sent_string(carriage_return); + } else { + out_char('\r'); + } + return TRUE; +} + /* * Set the hardware tabs on the terminal, using the 'ct' (clear all tabs), * 'st' (set one tab) and 'ch' (horizontal cursor addressing) capabilities. @@ -423,41 +445,28 @@ set_conversions(TTY * tty_settings) static bool reset_tabstops(int wide) { - if ((init_tabs != 8) && (VALID_STRING(set_tab) && VALID_STRING(clear_all_tabs))) { + if ((init_tabs != 8) + && VALID_NUMERIC(init_tabs) + && VALID_STRING(set_tab) + && VALID_STRING(clear_all_tabs)) { int c; - (void) putc('\r', my_file); /* Force to left margin. */ + to_left_margin(); tputs(clear_all_tabs, 0, out_char); - - for (c = 8; c < wide; c += 8) { - /* Get to the right column. In BSD tset, this used to try a bunch - * of half-clever things with cup and hpa, for an average saving of - * somewhat less than two character times per tab stop, less than - * .01 sec at 2400cps. We lost all this cruft because it seemed to - * be introducing some odd bugs. - * -----------12345678----------- */ - (void) fputs(" ", my_file); - tputs(set_tab, 0, out_char); + if (init_tabs > 1) { + if (init_tabs > wide) + init_tabs = (short) wide; + for (c = init_tabs; c < wide; c += init_tabs) { + fprintf(my_file, "%*s", init_tabs, " "); + tputs(set_tab, 0, out_char); + } + to_left_margin(); } - putc('\r', my_file); return (TRUE); } return (FALSE); } -static bool -sent_string(const char *s) -{ - bool sent = FALSE; - if (VALID_STRING(s)) { - tputs(s, 0, out_char); - sent = TRUE; - } - return sent; -} - -#define PUTCHAR(c) fputc(c, my_file) - /* Output startup string. */ bool send_init_strings(int fd GCC_UNUSED, TTY * old_settings) @@ -504,26 +513,19 @@ send_init_strings(int fd GCC_UNUSED, TTY * old_settings) && 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); - } else { - PUTCHAR('\r'); - } + need_flush |= to_left_margin(); need_flush |= sent_string(set_left_margin); if (VALID_STRING(parm_right_cursor)) { need_flush |= sent_string(TPARM_1(parm_right_cursor, columns - 1)); } else { for (i = 0; i < columns - 1; i++) { - PUTCHAR(' '); + out_char(' '); + need_flush = TRUE; } } need_flush |= sent_string(set_right_margin); - if (VALID_STRING(carriage_return)) { - need_flush |= sent_string(carriage_return); - } else { - PUTCHAR('\r'); - } + need_flush |= to_left_margin(); } need_flush |= reset_tabstops(columns); -- 2.44.0