Hello community,

here is the log from the commit of package ncurses for openSUSE:Factory checked 
in at 2020-10-30 11:45:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ncurses (Old)
 and      /work/SRC/openSUSE:Factory/.ncurses.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ncurses"

Fri Oct 30 11:45:39 2020 rev:179 rq:844100 version:6.2.MACRO

Changes:
--------
--- /work/SRC/openSUSE:Factory/ncurses/ncurses.changes  2020-10-22 
14:22:13.930747543 +0200
+++ /work/SRC/openSUSE:Factory/.ncurses.new.3463/ncurses.changes        
2020-10-30 11:45:42.573603285 +0100
@@ -1,0 +2,56 @@
+Mon Oct 26 12:31:53 UTC 2020 - Dr. Werner Fink <[email protected]>
+
+- Disable usage of libbsd as this one is not in bootstrap image 
+
+-------------------------------------------------------------------
+Mon Oct 26 07:45:58 UTC 2020 - Dr. Werner Fink <[email protected]>
+
+- Add ncurses patch 20201024
+  + provide workaround configure-check for bool when cross-compiling.
+  + fix a potential indexing error in _nc_parse_entry(), seen with
+    Herlim's test data using address-sanitizer.
+  + change a null-pointer check in set_curterm to a valid-string check,
+    needed in to tic's use-resolution work pad_char is cancelled
+    (report/testcase by Robert Sebastian Herlim)
+  + improve tic's -c option to validate the number and type of parameters
+    and compare against expected number/type before deciding which set of
+    parameter-lists to use in tparm calls (report/testcase by Robert
+    Sebastian Herlim).
+  + fix a link for tabs.1 manpage in announce.html.in (report by Nick
+    Black), as well as some fixes via linklint.
+- Update to tack 1.9 (patch 20200220)
+  * sysdep.c: gcc-warning
+  * tack.c: fix gcc warning for non-ncurses configuration
+  * init.c: zero-out the debug/log-pointers after closing them
+  * tack.1: add -d option, for debug.log
+  * output.c: use debug.log to record putp's and tput's which hint at
+    the testing done
+  * sysdep.c: use debug.log to record when the tty is set/reset
+  * tack.h: split-out log_chr and log_str
+  * tack.c: add -d option, for debug.log
+  * tack.1, tack.c, tack.h: add -l option
+  * tack.c: eliminate a confusing comparison for the logging-menu-entry
+    state by using #define'd strings for that and the hex-output menu.
+  * tack.c: use getopt
+  * fun.c, crum.c, edit.c:
+    fix coverity warning about copying into fixed-size buffer
+  * tack.c: do a sanity-check on $TERM
+  * aclocal.m4: resync with my-autoconf
+  * configure: regen
+  * aclocal.m4: split-out CF__CURSES_DATA to simplify ifdef's
+  * configure: regen
+- Use libbsd which provides strlcpy as well as strlcat to avoid
+  reinvent common BSD standard and string functions
+- Let makedepend find standard header files even if not below /usr/include
+
+-------------------------------------------------------------------
+Thu Oct 22 08:07:33 UTC 2020 - Dr. Werner Fink <[email protected]>
+
+- Add ncurses patch 20201017
+  + improve manpage typography.
+  + improve discussion in curs_addch.3x of the use of unctrl to display
+    nonprintable characters.
+  + add a note in terminfo.5 explaining that no-parameter strings such
+    as sgr0 or cnorm should not be used with tparm.
+
+-------------------------------------------------------------------

Old:
----
  tack-1.09-20200202.tgz

New:
----
  tack-1.09-20200220.tgz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ncurses.spec ++++++
--- /var/tmp/diff_new_pack.gLRMXK/_old  2020-10-30 11:45:43.621604213 +0100
+++ /var/tmp/diff_new_pack.gLRMXK/_new  2020-10-30 11:45:43.625604216 +0100
@@ -24,6 +24,7 @@
 %endif
 %bcond_with     memleakck
 %bcond_without  onlytinfo
+%bcond_with     libbsd
 
 %if %{with onlytinfo}
 %global soname_tinfo tinfo
@@ -42,6 +43,9 @@
 BuildRequires:  expect
 BuildRequires:  gcc-c++
 BuildRequires:  pkg-config
+%if %{with libbsd}
+BuildRequires:  pkgconfig(libbsd)
+%endif
 BuildRequires:  screen
 %if 0%{?suse_version} > 1130
 BuildRequires:  gpm-devel
@@ -73,7 +77,7 @@
 Source3:        README.devel
 Source4:        ncurses-rpmlintrc
 # Latest tack can be found at 
ftp://ftp.invisible-island.net/pub/ncurses/current/
-Source5:        
ftp://ftp.invisible-island.net/pub/ncurses/current/tack-1.09-20200202.tgz
+Source5:        
ftp://ftp.invisible-island.net/pub/ncurses/current/tack-1.09-20200220.tgz
 Source6:        edit.sed
 Source7:        baselibs.conf
 Patch0:         ncurses-6.2.dif
@@ -397,6 +401,24 @@
     cflags -Wl,--hash-size=8599     LDFLAGS
     cflags -Wl,--as-needed          LDFLAGS
     CXXFLAGS=$CFLAGS
+    CPPFLAGS=
+    include=
+    for header in stddef.h limits.h
+    do
+       set -- $(echo '#include <'$header'>'|gcc -E -|sed -rn 
's@[^/]*"([a-z0-9/\._-]+)/'$header'".*@\1@p'| sort -u)
+       for found
+       do
+           case "$found" in
+           /usr/include*) continue ;;
+           esac
+           include=${include+"-I$found $include"}
+       done
+    done
+    if test -n "$include"
+    then
+        CPPFLAGS="$include"
+       unset include
+    fi
     test -n "$TERM" || TERM=linux
     mkdir gzip
     cat > gzip/gzip <<-'EOF'
@@ -405,7 +427,7 @@
        EOF
     chmod 0755 gzip/gzip
     PATH=$PWD/gzip:$PATH
-    export CC CFLAGS CXX CXXFLAGS TERM LDFLAGS
+    export CC CFLAGS CXX CXXFLAGS CPPFLAGS TERM LDFLAGS
     #
     # Detect 64bit architecures and be sure that we use an
     # unsigned long for chtype to be backward compatible with

++++++ ncurses-6.2-patches.tar.bz2 ++++++
++++ 10552 lines of diff (skipped)

++++++ ncurses-6.2.dif ++++++
--- /var/tmp/diff_new_pack.gLRMXK/_old  2020-10-30 11:45:44.833605287 +0100
+++ /var/tmp/diff_new_pack.gLRMXK/_new  2020-10-30 11:45:44.833605287 +0100
@@ -22,8 +22,8 @@
 
 --- aclocal.m4
 +++ aclocal.m4 2020-08-31 12:06:53.682411288 +0000
-@@ -617,7 +617,7 @@ AC_MSG_CHECKING([for size of bool])
- AC_CACHE_VAL(cf_cv_type_of_bool,[
+@@ -639,7 +639,7 @@ AC_CHECK_SIZEOF(bool,,[
+ AC_CACHE_CHECK(for type of bool, cf_cv_type_of_bool,[
        rm -f cf_test.out
        AC_TRY_RUN([
 -#include <stdlib.h>
@@ -31,7 +31,7 @@
  #include <stdio.h>
  
  #if defined(__cplusplus)
-@@ -5476,12 +5476,15 @@ cat >>$cf_edit_man <<CF_EOF
+@@ -5506,12 +5506,15 @@ cat >>$cf_edit_man <<CF_EOF
                echo '? missing rename for '\$cf_source
                cf_target="\$cf_source"
        fi
@@ -49,7 +49,7 @@
        sed     -f $cf_man_alias \\
  CF_EOF
  
-@@ -5491,7 +5494,7 @@ cat >>$cf_edit_man <<CF_EOF
+@@ -5521,7 +5524,7 @@ cat >>$cf_edit_man <<CF_EOF
  CF_EOF
  else
  cat >>$cf_edit_man <<CF_EOF
@@ -58,7 +58,7 @@
  CF_EOF
  fi
  
-@@ -5531,7 +5534,7 @@ cat >>$cf_edit_man <<CF_EOF
+@@ -5561,7 +5564,7 @@ cat >>$cf_edit_man <<CF_EOF
                mv \$TMP.$cf_so_strip \$TMP
        fi
        fi
@@ -67,7 +67,7 @@
  CF_EOF
  fi
  
-@@ -5540,23 +5543,23 @@ case "$MANPAGE_FORMAT" in
+@@ -5570,23 +5573,23 @@ case "$MANPAGE_FORMAT" in
  cat >>$cf_edit_man <<CF_EOF
        if test \$form = format ; then
                # BSDI installs only .0 suffixes in the cat directories
@@ -97,7 +97,7 @@
                                for cf_alias in \$aliases
                                do
                                        if test \$section = 1 ; then
-@@ -5565,7 +5568,7 @@ cat >>$cf_edit_man <<CF_EOF
+@@ -5595,7 +5598,7 @@ cat >>$cf_edit_man <<CF_EOF
  
                                        if test "$MANPAGE_SYMLINKS" = yes ; then
                                                if test -f \$cf_alias\${suffix} 
; then
@@ -106,7 +106,7 @@
                                                        then
                                                                continue
                                                        fi
-@@ -5575,18 +5578,18 @@ CF_EOF
+@@ -5605,18 +5608,18 @@ CF_EOF
  case "x$LN_S" in
  (*-f)
  cat >>$cf_edit_man <<CF_EOF
@@ -128,7 +128,7 @@
                                                echo ".so \$cf_source" >\$TMP
  CF_EOF
  if test -n "$cf_compress" ; then
-@@ -5606,9 +5609,9 @@ cat >>$cf_edit_man <<CF_EOF
+@@ -5636,9 +5639,9 @@ cat >>$cf_edit_man <<CF_EOF
                        )
                )
        elif test \$verb = removing ; then
@@ -141,7 +141,7 @@
                )
                test -d \$cf_subdir\${section} &&
                test -n "\$aliases" && (
-@@ -5628,6 +5631,7 @@ cat >>$cf_edit_man <<CF_EOF
+@@ -5658,6 +5661,7 @@ cat >>$cf_edit_man <<CF_EOF
  #             echo ".hy 0"
                cat \$TMP
        fi

++++++ tack-1.09-20200202.tgz -> tack-1.09-20200220.tgz ++++++
++++ 2739 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/CHANGES new/tack-1.09-20200220/CHANGES
--- old/tack-1.09-20200202/CHANGES      2020-02-02 18:00:47.000000000 +0100
+++ new/tack-1.09-20200220/CHANGES      2020-02-21 02:55:16.000000000 +0100
@@ -1,3 +1,71 @@
+2020-02-20  Thomas E. Dickey  <[email protected]>
+
+       * sysdep.c: gcc-warning
+
+       * sysdep.c:
+       two changes to allow most tests to work with mintty in Cygwin and MSYS2
+       (the meta-mode test is one case that does not work):
+               a) change the VTIME value in tty_set() to 0, since interbyte 
timing
+                  does not work at all.  Without this fix, getchar() returns
+                  immediately without error, whether or not data is available.
+               b) in read_key(), do not exit from the loop as long as read() 
returns
+                  -1 (error).  Without this fix, read_key() returns ^@'s 
(nulls)
+                  in the function-key test.
+       These changes do not seem to break existing tests on other platforms,
+       e.g., Unix (AIX, HPUX, Solaris).
+
+       * tack.c: fix gcc warning for non-ncurses configuration
+
+       * package/debian/changelog, package/tack.spec, tack.h: bump
+
+       * init.c: zero-out the debug/log-pointers after closing them
+
+2020-02-17  Thomas E. Dickey  <[email protected]>
+
+       * tack.1: add -d option, for debug.log
+
+       * output.c:
+       use debug.log to record putp's and tput's which hint at the testing done
+
+       * sysdep.c: use debug.log to record when the tty is set/reset
+
+       * tack.h: split-out log_chr and log_str
+
+       * tack.c: add -d option, for debug.log
+
+2020-02-16  Thomas E. Dickey  <[email protected]>
+
+       * tack.1, tack.c, tack.h: add -l option
+
+       * tack.c:
+       eliminate a confusing comparison for the logging-menu-entry state by 
using
+       #define'd strings for that and the hex-output menu.
+
+2020-02-14  Thomas E. Dickey  <[email protected]>
+
+       * tack.c: use getopt
+
+       * fun.c, crum.c, edit.c:
+       fix coverity warning about copying into fixed-size buffer
+
+       * tack.c: do a sanity-check on $TERM
+
+2020-02-08  Thomas E. Dickey  <[email protected]>
+
+       * package/debian/changelog, package/tack.spec, tack.h: bump
+
+       * aclocal.m4: resync with my-autoconf
+
+       * configure: regen
+
+       * aclocal.m4: split-out CF__CURSES_DATA to simplify ifdef's
+
+2020-02-07  Thomas E. Dickey  <[email protected]>
+
+       * configure: regen
+
+       * aclocal.m4: workaround for Cygwin broken-linker
+
 2020-02-02  Thomas E. Dickey  <[email protected]>
 
        * tack.c: update copyright in version-message
@@ -619,13 +687,13 @@
        strict gcc 4.1.2 warnings with CentOS 5.7 64-bit
 
        * init.c, tack.c:
-       quiet unnecesary warning about ignoring return-value from system()
+       quiet unnecessary warning about ignoring return-value from system()
 
        * configure:
        regen with ac252 20120303 to work with Intel 12.0.3 compiler
 
        * tack.h:
-       quiet unnecesary warning about ignoring return-value from system()
+       quiet unnecessary warning about ignoring return-value from system()
 
 2012-03-02  Thomas E. Dickey  <[email protected]>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/crum.c new/tack-1.09-20200220/crum.c
--- old/tack-1.09-20200202/crum.c       2020-02-02 15:47:18.000000000 +0100
+++ new/tack-1.09-20200220/crum.c       2020-02-14 22:20:53.000000000 +0100
@@ -21,7 +21,7 @@
 
 #include <tack.h>
 
-MODULE_ID("$Id: crum.c,v 1.14 2020/02/02 14:47:18 tom Exp $")
+MODULE_ID("$Id: crum.c,v 1.15 2020/02/14 21:20:53 tom Exp $")
 
 /*
  * Test cursor movement.
@@ -33,7 +33,8 @@
 static void crum_move(TestList * t, int *state, int *ch);
 static void crum_os(TestList * t, int *state, int *ch);
 
-static char crum_text[5][80];
+#define CRUM_SIZE 80
+static char crum_text[5][CRUM_SIZE];
 
 TestList crum_test_list[] =
 {
@@ -378,7 +379,7 @@
        put_str("  Done. ");
     } else {
        can_test(buf, FLAG_TESTED);
-       strcpy(crum_text[n], &buf[2]);
+       sprintf(crum_text[n], "%.*s", CRUM_SIZE - 1, &buf[2]);
        crum_text[n][strlen(buf) - 3] = '\0';
 
        display_it(1 << n, buf);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/edit.c new/tack-1.09-20200220/edit.c
--- old/tack-1.09-20200202/edit.c       2020-02-02 16:31:09.000000000 +0100
+++ new/tack-1.09-20200220/edit.c       2020-02-14 22:13:30.000000000 +0100
@@ -24,7 +24,7 @@
 
 #include <tack.h>
 
-MODULE_ID("$Id: edit.c,v 1.47 2020/02/02 15:31:09 tom Exp $")
+MODULE_ID("$Id: edit.c,v 1.48 2020/02/14 21:13:30 tom Exp $")
 
 /*
  * These are adapted from tic.h
@@ -1378,7 +1378,7 @@
                ptextln(title);
                header = 0;
            }
-           strcpy(abuf, form_terminfo(a));
+           sprintf(abuf, "%.*s", (int) sizeof(abuf) - 1, form_terminfo(a));
            sprintf(temp, "%.30s %6s %.30s",
                    abuf, STR_NAME(i), form_terminfo(b));
            putln(temp);
@@ -1431,7 +1431,7 @@
     } else {
        x = tx_index[i];
        current_string = tx_cap[i];
-       strcpy(pad, STR_NAME(x));
+       sprintf(pad, "%.*s", (int) sizeof(pad) - 1, STR_NAME(x));
     }
     if (!current_string) {
        ptextln("That string is not currently defined.  Please enter a new 
value, including the padding delay:");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/fun.c new/tack-1.09-20200220/fun.c
--- old/tack-1.09-20200202/fun.c        2020-02-02 17:31:05.000000000 +0100
+++ new/tack-1.09-20200220/fun.c        2020-02-14 23:16:53.000000000 +0100
@@ -21,7 +21,9 @@
 
 #include <tack.h>
 
-MODULE_ID("$Id: fun.c,v 1.29 2020/02/02 16:31:05 tom Exp $")
+MODULE_ID("$Id: fun.c,v 1.30 2020/02/14 22:16:53 tom Exp $")
+
+#define COPY_1(target, source) sprintf(target, "%.*s", (int)sizeof(target) - 
1, source)
 
 /*
  * Test the function keys on the terminal.  The code for echo tests
@@ -111,7 +113,7 @@
        putln("Function key labels:");
        for (i = 0; i < key_count; ++i) {
            if (fk_label[i]) {
-               sprintf(outbuf, "%s %s",
+               sprintf(outbuf, "%.80s %.80s",
                        fk_name[i] ? fk_name[i] : "??", fk_label[i]);
                put_columns(outbuf, (int) strlen(outbuf), 16);
            }
@@ -135,15 +137,15 @@
        for (i = 0; scan_down[i]; i++) {
            if (!scan_tested[i]) {
                if (hex_output) {
-                   strcpy(outbuf, hex_expand_to(scan_down[i], 3));
+                   COPY_1(outbuf, hex_expand_to(scan_down[i], 3));
                } else {
-                   strcpy(outbuf, expand(scan_down[i]));
+                   COPY_1(outbuf, expand(scan_down[i]));
                }
                l = expand_chars;
                if (hex_output) {
-                   strcat(outbuf, hex_expand_to(scan_up[i], 3));
+                   COPY_1(outbuf, hex_expand_to(scan_up[i], 3));
                } else {
-                   strcat(outbuf, expand(scan_up[i]));
+                   COPY_1(outbuf, expand(scan_up[i]));
                }
                expand_chars += l;
                l = (int) strlen(scan_name[i]);
@@ -163,9 +165,9 @@
        for (i = 0; i < key_count; i++) {
            if (!fk_tested[i] && fk_name[i] != 0) {
                if (hex_output) {
-                   strcpy(outbuf, hex_expand_to(fkval[i], 3));
+                   COPY_1(outbuf, hex_expand_to(fkval[i], 3));
                } else {
-                   strcpy(outbuf, expand(fkval[i]));
+                   COPY_1(outbuf, expand(fkval[i]));
                }
                l = (int) strlen(fk_name[i]);
                if (((char_count + 16) & ~15) +
@@ -355,10 +357,10 @@
                    }
                    f = 1;
                }
-               sprintf(outbuf, " (%s)", fk_name[j]);
+               sprintf(outbuf, " (%.80s)", fk_name[j]);
                put_str(outbuf);
                if (fk_label[j]) {
-                   sprintf(outbuf, " <%s>", fk_label[j]);
+                   sprintf(outbuf, " <%.80s>", fk_label[j]);
                    put_str(outbuf);
                }
                fk_tested[j] = 1;
@@ -423,7 +425,7 @@
     } else {
        s = expand_to(keybuf, 10);
     }
-    sprintf(temp, "%s Unknown", s);
+    sprintf(temp, "%.80s Unknown", s);
     put_str(temp);
     for (j = 0; j < MAX_FK_UNK; j++) {
        if (j == funk) {
@@ -667,7 +669,7 @@
        sprintf(temp,
                "(pfloc) Set function key %d to execute a clear and print 
\"Done!\"", fk);
        ptextln(temp);
-       sprintf(temp, "%sDone!", liberated(clear_screen));
+       sprintf(temp, "%.*sDone!", TEMP_SIZE - 10, liberated(clear_screen));
        tc_putp(TPARM_2(pkey_local, fk, temp));
        sprintf(temp, "Hit function key %d.  Then hit return.", fk);
        ptextln(temp);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/init.c new/tack-1.09-20200220/init.c
--- old/tack-1.09-20200202/init.c       2020-02-02 17:31:05.000000000 +0100
+++ new/tack-1.09-20200220/init.c       2020-02-20 22:54:47.000000000 +0100
@@ -26,7 +26,7 @@
 
 #include <tack.h>
 
-MODULE_ID("$Id: init.c,v 1.40 2020/02/02 16:31:05 tom Exp $")
+MODULE_ID("$Id: init.c,v 1.41 2020/02/20 21:54:47 tom Exp $")
 
 FILE *debug_fp;
 char temp[TEMP_SIZE];
@@ -486,9 +486,11 @@
     }
     if (debug_fp) {
        fclose(debug_fp);
+       debug_fp = NULL;
     }
     if (log_fp) {
        fclose(log_fp);
+       log_fp = NULL;
     }
     tty_reset();
     fclose(stdin);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/output.c new/tack-1.09-20200220/output.c
--- old/tack-1.09-20200202/output.c     2020-02-02 17:31:05.000000000 +0100
+++ new/tack-1.09-20200220/output.c     2020-02-18 02:55:30.000000000 +0100
@@ -23,7 +23,7 @@
 #include <tack.h>
 #include <time.h>
 
-MODULE_ID("$Id: output.c,v 1.30 2020/02/02 16:31:05 tom Exp $")
+MODULE_ID("$Id: output.c,v 1.31 2020/02/18 01:55:30 tom Exp $")
 
 /* globals */
 long char_sent;                        /* number of characters sent */
@@ -34,7 +34,9 @@
 int can_go_home;               /* TRUE if we can fashion a home command */
 int can_clear_screen;          /* TRUE if we can somehow clear the screen */
 int raw_characters_sent;       /* Total output characters */
-static int log_count;          /* Number of characters on a log line */
+/* local */
+static int log_column;         /* Number of characters on a log line */
+static int in_logging;         /* Filter debug logging for clarity */
 
 /* translate mode default strings */
 #define TM_carriage_return     TM_string[0].value
@@ -81,21 +83,39 @@
     int ch;
     unsigned char buf;
 
+    if (debug_fp) {
+       fprintf(debug_fp, "getnext:\n");
+    }
     tc_putp(req_for_input);
     fflush(stdout);
     if (nodelay_read) {
        while (1) {
            ch = (int) read(fileno(stdin), &buf, sizeof(buf));
-           if (ch == -1)
+           if (ch == -1) {
+               if (debug_fp) {
+                   fprintf(debug_fp, "...getnext: EOF (nodelay)\n");
+               }
                return EOF;
-           if (ch == 1)
+           } else if (ch == 1) {
+               if (debug_fp) {
+                   fprintf(debug_fp, "...getnext: 0x%02X (nodelay)\n", ch);
+               }
                return buf;
+           }
        }
     }
     ch = getchar();
-    if (ch == EOF)
-       return EOF;
-    return ch & mask;
+    if (ch != EOF) {
+       ch &= mask;
+       if (debug_fp) {
+           fprintf(debug_fp, "...getnext: 0x%02X\n", ch);
+       }
+    } else {
+       if (debug_fp) {
+           fprintf(debug_fp, "...getnext: EOF\n");
+       }
+    }
+    return ch;
 }
 
 int
@@ -109,6 +129,41 @@
        return getnext(mask);
 }
 
+int
+log_chr(FILE *fp, int ch, int col)
+{
+    if (ch < 32) {
+       fprintf(fp, "<%s>", c0[ch]);
+       col += 5;
+    } else if (ch < 127) {
+       fprintf(fp, "%c", (char) ch);
+       col += 1;
+    } else {
+       fprintf(fp, "<%02x>", ch);
+       col += 4;
+    }
+    if ((ch == '\n' && col > 0) || col >= 80) {
+       fprintf(fp, "\n");
+       col = 0;
+    }
+    return col;
+}
+
+void
+log_str(FILE *fp, const char *value)
+{
+    if (value == 0) {
+       fputs("<null>", fp);
+    } else if (value == (const char *) -1) {
+       fputs("<cancel>", fp);
+    } else {
+       int ch;
+       while ((ch = UChar(*value++)) != '\0') {
+           log_chr(fp, ch, -10);
+       }
+    }
+}
+
 /*
 **     tc_putch(c)
 **
@@ -124,22 +179,7 @@
        fflush(stdout);
     }
     if (log_fp) {
-       /* terminal output logging */
-       unsigned ch = UChar(c);
-       if (ch < 32) {
-           fprintf(log_fp, "<%s>", c0[ch]);
-           log_count += 5;
-       } else if (ch < 127) {
-           fprintf(log_fp, "%c", (char) ch);
-           log_count += 1;
-       } else {
-           fprintf(log_fp, "<%02x>", ch);
-           log_count += 4;
-       }
-       if (ch == '\n' || log_count >= 80) {
-           fprintf(log_fp, "\n");
-           log_count = 0;
-       }
+       log_column = log_chr(log_fp, UChar(c), log_column);
     }
     return (c);
 }
@@ -153,6 +193,12 @@
 void
 tt_tputs(const char *string, int reps)
 {
+    ++in_logging;
+    if (debug_fp && (in_logging == 1)) {
+       fprintf(debug_fp, "tt_tputs: string=");
+       log_str(debug_fp, string);
+       fprintf(debug_fp, ", reps=%d\n", reps);
+    }
     if (string) {
        int i;
 
@@ -173,6 +219,7 @@
        }
        (void) tputs(string, reps, tc_putch);
     }
+    --in_logging;
 }
 
 /*
@@ -184,7 +231,14 @@
 void
 tt_putp(const char *string)
 {
+    ++in_logging;
+    if (debug_fp && (in_logging == 1)) {
+       fprintf(debug_fp, "tt_putp: string=");
+       log_str(debug_fp, string);
+       fprintf(debug_fp, "\n");
+    }
     tt_tputs(string, 1);
+    --in_logging;
 }
 
 /*
@@ -203,6 +257,12 @@
     if (string) {
        int i;
 
+       ++in_logging;
+       if (debug_fp && (in_logging == 1)) {
+           fprintf(debug_fp, "tc_putparm: string=");
+           log_str(debug_fp, string);
+           fprintf(debug_fp, ", reps=%d\n", reps);
+       }
        for (i = 0; i < TT_MAX; i++) {
            if (i >= ttp) {
                tt_cap[i] = string;
@@ -221,6 +281,7 @@
        (void) tputs(TPARM_2((NCURSES_CONST char *) string, arg1, arg2),
                     reps,
                     tc_putch);
+       --in_logging;
     }
 }
 
@@ -236,7 +297,14 @@
 {
     int rc = -1;
     if (VALID_STRING(string)) {
+       ++in_logging;
        rc = tputs(string, 1, tc_putch);
+       if (debug_fp && (in_logging == 1)) {
+           fprintf(debug_fp, "tc_putp: string=");
+           log_str(debug_fp, string);
+           fprintf(debug_fp, ", rc=%d\n", rc);
+       }
+       --in_logging;
     }
     return rc;
 }
@@ -646,6 +714,9 @@
 {                              /* clear the screen */
     int i;
 
+    if (debug_fp) {
+       fprintf(debug_fp, "put_clear:\n");
+    }
     if (clear_screen)
        tt_tputs(clear_screen, lines);
     else if (clr_eos && can_go_home) {
@@ -677,10 +748,16 @@
        }
     } else {
        can_clear_screen = FALSE;
+       if (debug_fp) {
+           fprintf(debug_fp, "...put_clear: ERR\n");
+       }
        return;
     }
     char_count = line_count = 0;
     can_clear_screen = TRUE;
+    if (debug_fp) {
+       fprintf(debug_fp, "...put_clear: OK\n");
+    }
 }
 
 /*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/package/debian/changelog 
new/tack-1.09-20200220/package/debian/changelog
--- old/tack-1.09-20200202/package/debian/changelog     2020-02-02 
17:34:25.000000000 +0100
+++ new/tack-1.09-20200220/package/debian/changelog     2020-02-21 
01:02:10.000000000 +0100
@@ -1,3 +1,15 @@
+tack (1.09+20200220) unstable; urgency=low
+
+  * maintenance updates
+
+ -- Thomas E. Dickey <[email protected]>  Thu, 20 Feb 2020 18:31:45 
-0500
+
+tack (1.09+20200208) unstable; urgency=low
+
+  * maintenance updates
+
+ -- Thomas E. Dickey <[email protected]>  Thu, 08 Feb 2020 20:55:01 
-0500
+
 tack (1.09+20200202) unstable; urgency=low
 
   * update copyright and license
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/package/tack.spec 
new/tack-1.09-20200220/package/tack.spec
--- old/tack-1.09-20200202/package/tack.spec    2020-02-02 17:58:47.000000000 
+0100
+++ new/tack-1.09-20200220/package/tack.spec    2020-02-21 01:02:10.000000000 
+0100
@@ -1,8 +1,8 @@
 Summary:  terminfo action checker
 %define AppProgram tack
 %define AppVersion 1.09
-%define AppRelease 20200202
-# $XTermId: tack.spec,v 1.19 2020/02/02 16:58:47 tom Exp $
+%define AppRelease 20200220
+# $XTermId: tack.spec,v 1.21 2020/02/21 00:02:10 tom Exp $
 Name: %{AppProgram}
 Version: %{AppVersion}
 Release: %{AppRelease}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/sysdep.c new/tack-1.09-20200220/sysdep.c
--- old/tack-1.09-20200202/sysdep.c     2020-02-02 15:47:18.000000000 +0100
+++ new/tack-1.09-20200220/sysdep.c     2020-02-21 02:55:16.000000000 +0100
@@ -44,7 +44,7 @@
 #endif
 #endif
 
-MODULE_ID("$Id: sysdep.c,v 1.30 2020/02/02 14:47:18 tom Exp $")
+MODULE_ID("$Id: sysdep.c,v 1.33 2020/02/21 01:55:16 tom Exp $")
 
 #ifdef TERMIOS
 #define PUT_TTY(fd, buf) tcsetattr(fd, TCSAFLUSH, buf)
@@ -99,6 +99,9 @@
 void
 tty_raw(int minch GCC_UNUSED, int mask)
 {                              /* set tty to raw noecho */
+    if (debug_fp) {
+       fprintf(debug_fp, "tty_raw:\n");
+    }
     new_modes = old_modes;
 #ifdef TERMIOS
 #if HAVE_SELECT
@@ -134,18 +137,28 @@
 #else
     new_modes.sg_flags |= RAW;
 #endif
-    if (not_a_tty)
+    if (not_a_tty) {
+       if (debug_fp) {
+           fprintf(debug_fp, "...tty_raw: not a tty\n");
+       }
        return;
+    }
     PUT_TTY(fileno(stdin), &new_modes);
+    if (debug_fp) {
+       fprintf(debug_fp, "...tty_raw: done\n");
+    }
 }
 
 void
 tty_set(void)
 {                              /* set tty to special modes */
+    if (debug_fp) {
+       fprintf(debug_fp, "tty_set:\n");
+    }
     new_modes = old_modes;
 #ifdef TERMIOS
     new_modes.c_cc[VMIN] = 1;
-    new_modes.c_cc[VTIME] = 1;
+    new_modes.c_cc[VTIME] = 0;
     new_modes.c_lflag &= (tcflag_t) ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | 
ECHONL);
 #if defined(ONLCR) && defined(OCRNL) && defined(ONLRET) && defined(OFILL)
     new_modes.c_oflag &= (tcflag_t) ~(ONLCR | OCRNL | ONLRET | OFILL);
@@ -188,19 +201,36 @@
        new_modes.c_oflag &= (tcflag_t) ~OPOST;
 #else
     new_modes.sg_flags |= RAW;
-    if (not_a_tty)
+    if (not_a_tty) {
+       if (debug_fp) {
+           fprintf(debug_fp, "...tty_set: not a tty\n");
+       }
        return;
+    }
 #endif
     PUT_TTY(fileno(stdin), &new_modes);
+    if (debug_fp) {
+       fprintf(debug_fp, "...tty_set: done\n");
+    }
 }
 
 void
 tty_reset(void)
 {                              /* reset the tty to the original modes */
+    if (debug_fp) {
+       fprintf(debug_fp, "tty_reset:\n");
+    }
     fflush(stdout);
-    if (not_a_tty)
+    if (not_a_tty) {
+       if (debug_fp) {
+           fprintf(debug_fp, "...tty_reset: not a tty\n");
+       }
        return;
+    }
     PUT_TTY(fileno(stdin), &old_modes);
+    if (debug_fp) {
+       fprintf(debug_fp, "...tty_reset: done\n");
+    }
 }
 
 void
@@ -389,11 +419,14 @@
     int ask, i, l;
     char *s;
 
+    if (debug_fp) {
+       fprintf(debug_fp, "read_key: max=%lu\n", (unsigned long) max);
+    }
     *buf = '\0';
     s = buf;
     fflush(stdout);
     /* ATT unix may return 0 or 1, Berkeley Unix should be 1 */
-    while (read(fileno(stdin), s, (size_t) 1) == 0) {
+    while ((l = (int) read(fileno(stdin), s, (size_t) 1)) <= 0) {
        ;                       /* EMPTY */
     }
     ++s;
@@ -422,6 +455,11 @@
            *s = (char) (*s & char_mask);
        }
     }
+    if (debug_fp) {
+       fprintf(debug_fp, "...read_key: result=");
+       log_str(debug_fp, buf);
+       fprintf(debug_fp, "\n");
+    }
 }
 
 void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/tack.1 new/tack-1.09-20200220/tack.1
--- old/tack-1.09-20200202/tack.1       2020-02-02 15:47:18.000000000 +0100
+++ new/tack-1.09-20200220/tack.1       2020-02-18 02:57:20.000000000 +0100
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tack.1,v 1.6 2020/02/02 14:47:18 tom Exp $
+.\" $Id: tack.1,v 1.8 2020/02/18 01:57:20 tom Exp $
 .TH tack 1 ""
 .ie \n(.g .ds `` \(lq
 .el       .ds `` ``
@@ -38,13 +38,19 @@
 .SH NAME
 \fBtack\fR \- \fIterminfo\fR action checker
 .SH SYNOPSIS
-\fBtack\fR [\-itV] [term]
+\fBtack\fR [\-diltV] [term]
 .br
 .SH DESCRIPTION
 The \fBtack\fR program has three purposes:
-(1) to help you build a new terminfo entry describing an unknown terminal,
-(2) to test the correctness of an existing entry, and
-(3) to develop the correct pad timings needed to ensure that screen updates
+.TP 4
+(1)
+to help you build a new terminfo entry describing an unknown terminal,
+.TP 4
+(2)
+to test the correctness of an existing entry, and
+.TP 4
+(3)
+to develop the correct pad timings needed to ensure that screen updates
 do not fall behind the incoming data stream.
 .PP
 \fBTack\fR presents a series of screen-painting and interactive
@@ -54,16 +60,39 @@
 the terminal operates.
 .SS OPTIONS
 .TP
+.I "\-d"
+Start \fBtack\fP with the debug-file \*(``debug.log\*('' opened.
+.TP
 .I "\-i"
 Usually \fBtack\fR will send the reset and init strings to the terminal
 when the program starts up.  The \fI\-i\fR option will inhibit the
 terminal initialization.
 .TP
+.I "\-l"
+Start \fBtack\fP with the log-file \*(``tack.log\*('' opened.
+This is also a menu item.
+.TP
 .I "\-t"
 Tell \fBtack\fR to override the terminfo settings for basic terminal
 functions.  When this option is set \fBtack\fR will translate
-(cr) to \\r, (cud1) to \\n, (ind) to \\n, (nel) to \\r\\n,
-(cub1) to \\b, (bel) to \\007, (ff) to \\f and (ht) to \\t.
+.RS
+.PP
+(cr) to \\r,
+.br
+(cud1) to \\n,
+.br
+(ind) to \\n,
+.br
+(nel) to \\r\\n,
+.br
+(cub1) to \\b,
+.br
+(bel) to \\007,
+.br
+(ff) to \\f and
+.br
+(ht) to \\t.
+.RE
 .TP
 .I "\-V"
 Display the version information and exit.
@@ -98,7 +127,7 @@
 By now you must be wondering why the terminfo names are enclosed
 in parenthesis.  This has no profound meaning other than it makes
 them stand out.  The \fBtack\fR program uses this convention any time
-it displays a terminfo name.  Remember \fBtack\fR is designed to
+it displays a terminfo name.  Remember that \fBtack\fR is designed to
 rely on as little of the terminfo entry as possible.
 .SH CREATING NEW ENTRIES
 \fBTack\fR has a number of tools that are designed to help gather
@@ -201,14 +230,14 @@
 escape sequences or the escape character itself, causing some really
 strange-looking displays.  This kind of glitch is called an \fIoverrun\fR.
 .PP
-In terminfo entries, you can attach a \fBpad time\fR to each string capability
+In terminfo entries, you can attach a \fIpad time\fR to each string capability
 that is a number of milliseconds to delay after sending it.  This will give
 the terminal time to catch up and avoid overruns.
 .PP
 If you are running a software terminal emulator, or you are on an X pseudo-tty,
 or your terminal is on an RS-232C line which correctly handles RTS/CTS
 hardware flow control, then pads are not strictly necessary.  However, some
-display packages (such as ncurses(3X)) use the pad counts to calculate
+display packages (such as \fBncurses\fP(3X)) use the pad counts to calculate
 the fastest way to implement certain functions.
 For example: scrolling the screen may be faster than deleting the top line.
 .PP
@@ -252,8 +281,13 @@
 acknowledge string.  A VT-100 style terminal could set u9=\\E[c
 and u8=\\E[?1;0c.
 Acknowledge strings fall into two categories. 
-1) Strings with a unique terminating character and,
-2) strings of fixed length.
+.TP 4
+1)
+Strings with a unique terminating character and,
+.TP 4
+2)
+strings of fixed length.
+.PP
 The acknowledge string for the VT-100 is of the first type since
 it always ends with the letter \*(``c\*(''.  Some Tektronics terminals
 have fixed length acknowledge strings.  \fBTack\fR supports both
@@ -334,10 +368,20 @@
 .SH BUGS
 If the screen size is incorrect, many of the tests will fail.
 .SH AUTHOR
+.na
+.hy 0
+.PP
 Concept, design, and original implementation by
 Daniel Weaver <[email protected]>.
+.PP
 Portions of the code and
 documentation are by Eric S. Raymond <[email protected]>.
+.PP
+Refactored by Thomas E. Dickey to
+eliminate dependency on \fBncurses\fP internal functions,
+and to allow \fBtack\fP
+to work with other implementations
+of curses and terminfo than \fBncurses\fP.
 .\"#
 .\"# The following sets edit modes for GNU EMACS
 .\"# Local Variables:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/tack.c new/tack-1.09-20200220/tack.c
--- old/tack-1.09-20200202/tack.c       2020-02-02 18:00:47.000000000 +0100
+++ new/tack-1.09-20200220/tack.c       2020-02-21 02:03:49.000000000 +0100
@@ -21,8 +21,9 @@
 
 #include <tack.h>
 #include <stdarg.h>
+#include <unistd.h>
 
-MODULE_ID("$Id: tack.c,v 1.31 2020/02/02 17:00:47 tom Exp $")
+MODULE_ID("$Id: tack.c,v 1.37 2020/02/21 01:03:49 tom Exp $")
 
 /*
    This program is designed to test terminfo, not curses.  Therefore
@@ -70,6 +71,8 @@
 static void tools_hex_echo(TestList *, int *, int *);
 static void tools_debug(TestList *, int *, int *);
 
+#define MENU_ENABLE_HEX_OUTPUT  "h) enable hex output on echo tool"
+#define MENU_DISABLE_HEX_OUTPUT "h) disable hex output on echo tool"
 static char hex_echo_menu_entry[80];
 
 static TestList tools_test_list[] =
@@ -219,7 +222,9 @@
 static void start_basic(TestList *, int *, int *);
 static void start_log(TestList *, int *, int *);
 
-static char logging_menu_entry[80] = "l) start logging";
+#define MENU_START_LOGGING "l) start logging"
+#define MENU_STOP_LOGGING  "l) stop logging"
+static char logging_menu_entry[80] = MENU_START_LOGGING;
 
 static TestList start_test_list[] =
 {
@@ -264,12 +269,10 @@
 {
     if (hex_out) {
        hex_out = FALSE;
-       strcpy(hex_echo_menu_entry,
-              "h) enable hex output on echo tool");
+       strcpy(hex_echo_menu_entry, MENU_ENABLE_HEX_OUTPUT);
     } else {
        hex_out = TRUE;
-       strcpy(hex_echo_menu_entry,
-              "h) disable hex output on echo tool");
+       strcpy(hex_echo_menu_entry, MENU_DISABLE_HEX_OUTPUT);
     }
 }
 
@@ -308,11 +311,9 @@
               int *ch GCC_UNUSED)
 {
     if (hex_out) {
-       strcpy(hex_echo_menu_entry,
-              "h) disable hex output on echo tool");
+       strcpy(hex_echo_menu_entry, MENU_DISABLE_HEX_OUTPUT);
     } else {
-       strcpy(hex_echo_menu_entry,
-              "h) enable hex output on echo tool");
+       strcpy(hex_echo_menu_entry, MENU_ENABLE_HEX_OUTPUT);
     }
     menu_display(&tools_menu, 0);
 }
@@ -523,13 +524,13 @@
             int *state GCC_UNUSED,
             int *ch GCC_UNUSED)
 {
-    if (logging_menu_entry[5] == 'a') {
+    if (!strcmp(logging_menu_entry, MENU_START_LOGGING)) {
        ptextln("The log file will capture all characters sent to the 
terminal.");
-       if ((log_fp = fopen("tack.log", "w"))) {
-           ptextln("Start logging to file: tack.log");
-           strcpy(logging_menu_entry, "l) stop logging");
+       if ((log_fp = fopen(LOG_FILENAME, "w"))) {
+           ptextln("Start logging to file: " LOG_FILENAME);
+           strcpy(logging_menu_entry, MENU_STOP_LOGGING);
        } else {
-           ptextln("File open error: tack.log");
+           ptextln("File open error: " LOG_FILENAME);
        }
     } else {
        if (log_fp) {
@@ -537,7 +538,7 @@
            log_fp = 0;
        }
        ptextln("Terminal output logging stopped.");
-       strcpy(logging_menu_entry, "l) start logging");
+       strcpy(logging_menu_entry, MENU_START_LOGGING);
     }
 }
 
@@ -550,7 +551,7 @@
 show_usage(
              char *name)
 {
-    (void) fprintf(stderr, "usage: %s [-itV] [term]\n", name);
+    (void) fprintf(stderr, "usage: %s [-diltV] [term]\n", name);
 }
 
 /*
@@ -594,6 +595,28 @@
 }
 #endif
 
+static char *
+validate_term(char *value)
+{
+    char *result = NULL;
+    if (value != NULL && *value != '\0' && strlen(value) <= 128) {
+       int n;
+       result = value;
+       for (n = 0; value[n] != '\0'; ++n) {
+           int ch = UChar(value[n]);
+           if (ch >= 128 || ch == '/' || !isgraph(ch)) {
+               result = NULL;
+               break;
+           }
+       }
+    }
+    if (result == NULL) {
+       fprintf(stderr, "no useful value found for $TERM\n");
+       ExitProgram(EXIT_FAILURE);
+    }
+    return strdup(result);
+}
+
 /*****************************************************************************
  *
  * Main sequence
@@ -603,39 +626,56 @@
 int
 main(int argc, char *argv[])
 {
+#if TACK_CAN_EDIT
     int i, j;
-    char *term_variable;
+#endif
+    int ch;
 
     /* scan the option flags */
     send_reset_init = TRUE;
     translate_mode = FALSE;
-    term_variable = getenv("TERM");
     tty_can_sync = SYNC_NOT_TESTED;
-    for (i = 1; i < argc; i++) {
-       if (argv[i][0] == '-') {
-           for (j = 1; argv[i][j]; j++) {
-               switch (argv[i][j]) {
-               case 'V':
-                   print_version();
-                   ExitProgram(EXIT_FAILURE);
-                   /* NOTREACHED */
-               case 'i':
-                   send_reset_init = FALSE;
-                   break;
-               case 't':
-                   translate_mode = FALSE;
-                   break;
-               default:
-                   show_usage(argv[0]);
-                   ExitProgram(EXIT_SUCCESS);
-                   /* NOTREACHED */
-               }
+    while ((ch = getopt(argc, argv, "diltV")) != -1) {
+       switch (ch) {
+       case 'V':
+           print_version();
+           ExitProgram(EXIT_FAILURE);
+           /* NOTREACHED */
+       case 'd':
+           if ((debug_fp = fopen(DBG_FILENAME, "w")) == 0) {
+               perror(DBG_FILENAME);
+               ExitProgram(EXIT_FAILURE);
            }
-       } else {
-           term_variable = argv[i];
+           break;
+       case 'i':
+           send_reset_init = FALSE;
+           break;
+       case 'l':
+           if ((log_fp = fopen(LOG_FILENAME, "w"))) {
+               strcpy(logging_menu_entry, MENU_STOP_LOGGING);
+           } else {
+               perror(LOG_FILENAME);
+               ExitProgram(EXIT_FAILURE);
+           }
+           break;
+       case 't':
+           translate_mode = FALSE;
+           break;
+       default:
+           show_usage(argv[0]);
+           ExitProgram(EXIT_SUCCESS);
+           /* NOTREACHED */
        }
     }
-    tty_basename = strdup(term_variable ? term_variable : "unknown");
+
+    if (optind >= argc) {
+       tty_basename = validate_term(getenv("TERM"));
+    } else if (optind + 1 >= argc) {
+       tty_basename = validate_term(argv[optind]);
+    } else {
+       show_usage(argv[0]);
+       ExitProgram(EXIT_FAILURE);
+    }
 
     curses_setup(argv[0]);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/tack-1.09-20200202/tack.h new/tack-1.09-20200220/tack.h
--- old/tack-1.09-20200202/tack.h       2020-02-02 17:34:56.000000000 +0100
+++ new/tack-1.09-20200220/tack.h       2020-02-21 01:02:10.000000000 +0100
@@ -19,7 +19,7 @@
 ** Boston, MA 02110-1301, USA
 */
 
-/* $Id: tack.h,v 1.80 2020/02/02 16:34:56 tom Exp $ */
+/* $Id: tack.h,v 1.84 2020/02/21 00:02:10 tom Exp $ */
 
 #ifndef NCURSES_TACK_H_incl
 #define NCURSES_TACK_H_incl 1
@@ -28,7 +28,7 @@
 
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 9
-#define PATCH_VERSION 20200202
+#define PATCH_VERSION 20200220
 
 #ifdef HAVE_CONFIG_H
 #include <ncurses_cfg.h>
@@ -225,6 +225,9 @@
 #define NAME_SIZE 32
 #define TEMP_SIZE 1024
 
+#define LOG_FILENAME "tack.log"
+#define DBG_FILENAME "debug.log"
+
 extern FILE *log_fp;
 extern FILE *debug_fp;
 extern int debug_level;
@@ -463,10 +466,12 @@
 extern char *print_expand(char *);
 extern int getchp(int);
 extern int getnext(int);
+extern int log_chr(FILE *, int, int);
 extern int tc_putp(const char *);
 extern int wait_here(void);
 extern void go_home(void);
 extern void home_down(void);
+extern void log_str(FILE *, const char *);
 extern void maybe_wait(int);
 extern void ptext(const char *);
 extern void ptextln(const char *);


Reply via email to