]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20190223
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 24 Feb 2019 01:51:57 +0000 (01:51 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 24 Feb 2019 01:51:57 +0000 (01:51 +0000)
+ 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).

16 files changed:
NEWS
VERSION
dist.mk
misc/terminfo.src
ncurses/curses.priv.h
ncurses/tty/lib_mvcur.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
progs/reset_cmd.c
progs/tic.c
test/demo_tabs.c

diff --git a/NEWS b/NEWS
index 130758dbd4153312edbac53c13a13ddc7002bfdd..5aac7b72ac626e9cab4aec3316b1671e5e42327a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- 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
 -------------------------------------------------------------------------------
 
 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.
 
 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.
 20190216
        + improve manual page description of TABSIZE.
        + add test/demo_tabs program.
diff --git a/VERSION b/VERSION
index c1cda65e6f369d11bb329b02e3680c4a71097605..09faf76f8df8da53d01c917da981408696cbed01 100644 (file)
--- 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 636d49f33808da3a0e80d7e5d6a152dff79243ce..e51afa36036a953c2d6dc53d8749fb50bbe5180e 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # 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
 # 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
 # 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)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index d147bfa853d98d97d0b579c7489b1ecab92f5951..d3d404c9ae945399deda7d46d3fa977f8df6e6b5 100644 (file)
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #      bug-ncurses@gnu.org
 #
 # 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
 #
 # 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,
        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: <edward@onyx.berkeley.edu> Thu Jul  9 09:27:33 1981
        kF4=^B$\r, kF5=^B%\r, kF6=^B&\r, kF7=^B'\r, kF8=^B(\r,
        use=regent40+,
 # From: <edward@onyx.berkeley.edu> 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)
 #
 #      + 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!
 ######## SHANTIH!  SHANTIH!  SHANTIH!
index 1ec7e73ee0c9426724100bc703395da96bc5ceda..4807761c7e55d4a120f62c54bb176d7cee73160f 100644 (file)
@@ -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
  *
  *
  *     curses.priv.h
  *
@@ -539,6 +539,8 @@ NCURSES_EXPORT(int *)        _nc_ptr_Escdelay (SCREEN *);
 
 #endif
 
 
 #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()), \
 #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \
            __FILE__, __LINE__, \
            (unsigned long) (pthread_self()), \
index cb9fd8697bd79bcb451df8b671aef8ce07eb97c9..313d488ad07c6d809d8d8b3ea207178f10df05f2 100644 (file)
@@ -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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 #define CUR SP_TERMTYPE
 #endif
 
 #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 */
 
 
 #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
     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 {
        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;
 
        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] == '?') {
        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] <term>    -- load terminal info for type <term>");
-           (void) puts("d[elete] <cap>   -- 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] <num>  -- torture-test with <num> 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] <term>    -- load terminal info for type <term>");
+           PUTS("d[elete] <cap>   -- 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] <num>  -- torture-test with <num> 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;
 
        } else if (sscanf(buf, "%d %d %d %d", &fy, &fx, &ty, &tx) == 4) {
            struct timeval before, after;
 
index f1b538349df9bee42812e1ce726cccfde7a2f58b..0d99aee4d37e5db6444b4fccd780242057c76d5a 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190216) unstable; urgency=low
+ncurses6 (6.1+20190223) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Wed, 13 Feb 2019 17:19:33 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 23 Feb 2019 11:29:00 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index f1b538349df9bee42812e1ce726cccfde7a2f58b..0d99aee4d37e5db6444b4fccd780242057c76d5a 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190216) unstable; urgency=low
+ncurses6 (6.1+20190223) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Wed, 13 Feb 2019 17:19:33 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 23 Feb 2019 11:29:00 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index f0ae539ba76c8b1b9c601fd7b62fc62e704111ec..06a3a6f4ba6e73c073a6133557f4d050e441c905 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190216) unstable; urgency=low
+ncurses6 (6.1+20190223) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Wed, 13 Feb 2019 17:19:33 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 23 Feb 2019 11:29:00 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 9fabdcbbeebf4d18f1c48eb906955b9eebbf30b3..ba50be5cd0e06bc42f14f2510f476411e2fda010 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.314 2019/02/13 22:19:33 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.315 2019/02/23 16:29:00 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "1"\r
 !define VERSION_YYYY  "2019"\r
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "1"\r
 !define VERSION_YYYY  "2019"\r
-!define VERSION_MMDD  "0216"\r
+!define VERSION_MMDD  "0223"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 11df0aa90ebf629697b9983fb97b301812a08bc2..353545863b0f23cd0144df622b08ae8d83654a62 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
 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
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index b74ee1e1b21699df5dd02c8e2b078ba9bc5d3297..77abab10268b3299011b6befb0e6af86d249a1c8 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
 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
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index b699a9a91782abd1af62456dd28e04565adfda82..9921122076989d47d244dbbe8043f1a42e3450f1 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.1
 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
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index a4e44efc0f572b9d8abf572bdbe27684ce78ccfa..058ebf9c5a0ddca1df1c09c0bebc140e779e3baa 100644 (file)
@@ -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            *
  *                                                                          *
  * 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 <sys/ptem.h>
 #endif
 
 #include <sys/ptem.h>
 #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,
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -341,7 +341,7 @@ default_erase(void)
     int result;
 
     if (over_strike
     int result;
 
     if (over_strike
-       && key_backspace != 0
+       && VALID_STRING(key_backspace)
        && strlen(key_backspace) == 1) {
        result = key_backspace[0];
     } else {
        && 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") */
 #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);
        /* 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") */
     }
 #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);
        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)
 {
 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. */
        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;
 sent_string(const char *s)
 {
     bool sent = FALSE;
-    if (s != 0) {
+    if (VALID_STRING(s)) {
        tputs(s, 0, out_char);
        sent = TRUE;
     }
        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) {
     }
 #endif
     if (use_reset || use_init) {
-       if (init_prog != 0) {
+       if (VALID_STRING(init_prog)) {
            IGNORE_RC(system(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)
                                  : 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)
            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
            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);
            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);
                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 {
                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);
                }
            }
            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');
                need_flush |= sent_string(carriage_return);
            } else {
                PUTCHAR('\r');
index 9efb4b034d16bb08154cd81590eb589974da4b55..705cac6caf9f731af9b25012c1f218178dd8a5e6 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
 #include <parametrized.h>
 #include <transform.h>
 
-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 "<stdin>"
 
 
 #define STDIN_NAME "<stdin>"
 
@@ -1095,6 +1095,50 @@ main(int argc, char *argv[])
 static void
 check_acs(TERMTYPE2 *tp)
 {
 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];
     if (VALID_STRING(acs_chars)) {
        const char *boxes = "lmkjtuvwqxn";
        char mapped[256];
index 68023a328205940287d36801156344aa12f8ae2e..51850e4cb992febd70e98166d954c1971490e539 100644 (file)
 /*
  * Author: Thomas E. Dickey
  *
 /*
  * 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.
  */
  *
  * A simple demo of tabs in curses.
  */
+#define USE_TINFO
 #include "test.priv.h"
 
 static void
 #include "test.priv.h"
 
 static void
@@ -82,8 +83,10 @@ main(int argc, char *argv[])
     cbreak();
     if (curses_stops > 0)
        set_tabsize(curses_stops);
     cbreak();
     if (curses_stops > 0)
        set_tabsize(curses_stops);
+#if HAVE_TIGETNUM
     tabstop = tigetnum("it");
     if (tabstop <= 0)
     tabstop = tigetnum("it");
     if (tabstop <= 0)
+#endif
        tabstop = 8;
     for (row = 0; row < LINES; ++row) {
        move(row, 0);
        tabstop = 8;
     for (row = 0; row < LINES; ++row) {
        move(row, 0);