From 09510c46b309ca683f2e98a1213a54ece90d0bdc Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Sat, 9 Jun 2018 13:02:19 +0000 Subject: [PATCH] New upstream version 1.30 --- AUTHORS | 1 + ChangeLog | 16 +++++++++++++- Makefile.in | 12 +++++------ README | 2 ++ aclocal.m4 | 44 +++++++++++++++++++------------------- configure | 20 ++++++++--------- configure.ac | 2 +- man/Makefile.in | 4 ++-- man/tio.1 | 14 ++++++------ src/Makefile.in | 4 ++-- src/bash-completion/tio.in | 2 +- src/tty.c | 17 +++++++++++++-- 12 files changed, 84 insertions(+), 54 deletions(-) diff --git a/AUTHORS b/AUTHORS index 5d60aa9..6ee6e96 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,5 +13,6 @@ Robert Scheck Dmitri Goutnik Daniel Engberg Petr Vaněk +qianfan Zhao Thanks to everyone who has contributed to this project. diff --git a/ChangeLog b/ChangeLog index bff2d3c..d9b6806 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ -=== tio v1.29 === +=== tio v1.30 === + + + +Changes since tio v1.29: + + * Update README + + * Update man page and bash completion + + * Update AUTHORS + +qianfan Zhao: + + * ONLCRNL: change the method to map NL to CR-NL diff --git a/Makefile.in b/Makefile.in index 8d155d1..cf7a164 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -514,7 +514,7 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -539,7 +539,7 @@ dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -557,7 +557,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -567,7 +567,7 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac diff --git a/README b/README index c3b2e24..6e1bf12 100644 --- a/README +++ b/README @@ -57,6 +57,7 @@ The latest release version is available at https://tio.github.io + 3.1 Installation using release tarball Install steps: @@ -67,6 +68,7 @@ See INSTALL file for more installation details. + 3.2 Installation using package Tio comes prepackaged for various GNU/Linux distributions. Visit diff --git a/aclocal.m4 b/aclocal.m4 index f3018f6..df8ff83 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -605,7 +605,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -626,7 +626,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -647,7 +647,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -697,7 +697,7 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -736,7 +736,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -765,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -812,7 +812,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -831,7 +831,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -912,7 +912,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -972,7 +972,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1000,7 +1000,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1019,7 +1019,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/configure b/configure index 93d59db..1bfa018 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tio 1.29. +# Generated by GNU Autoconf 2.69 for tio 1.30. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -576,8 +576,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tio' PACKAGE_TARNAME='tio' -PACKAGE_VERSION='1.29' -PACKAGE_STRING='tio 1.29' +PACKAGE_VERSION='1.30' +PACKAGE_STRING='tio 1.30' PACKAGE_BUGREPORT='' PACKAGE_URL='https://tio.github.io' @@ -1241,7 +1241,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tio 1.29 to adapt to many kinds of systems. +\`configure' configures tio 1.30 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1308,7 +1308,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tio 1.29:";; + short | recursive ) echo "Configuration of tio 1.30:";; esac cat <<\_ACEOF @@ -1407,7 +1407,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tio configure 1.29 +tio configure 1.30 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1508,7 +1508,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tio $as_me 1.29, which was +It was created by tio $as_me 1.30, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2373,7 +2373,7 @@ fi # Define the identity of the package. PACKAGE='tio' - VERSION='1.29' + VERSION='1.30' cat >>confdefs.h <<_ACEOF @@ -4990,7 +4990,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tio $as_me 1.29, which was +This file was extended by tio $as_me 1.30, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5057,7 +5057,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tio config.status 1.29 +tio config.status 1.30 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 78a3dae..430c0d3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.68]) -AC_INIT([tio], [1.29], [], [tio], [https://tio.github.io]) +AC_INIT([tio], [1.30], [], [tio], [https://tio.github.io]) AC_CONFIG_HEADERS([src/include/config.h]) AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip -Wall -Werror]) AM_SILENT_RULES([yes]) diff --git a/man/Makefile.in b/man/Makefile.in index ab1713b..42fa204 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/man/tio.1 b/man/tio.1 index f666ad9..f8566e4 100644 --- a/man/tio.1 +++ b/man/tio.1 @@ -1,4 +1,4 @@ -.TH "tio" "1" "November 2017" +.TH "tio" "1" "April 2018" .SH "NAME" tio \- a simple TTY terminal I/O application @@ -63,20 +63,20 @@ Map (replace, translate) special characters on input or output. The following ma .RS .TP 12n +.IP "\fBICRNL" +Map CR to NL on input (unless IGNCR is set). +.IP "\fBIGNCR" +Ignore CR on input. .IP "\fBINLCR" Map NL to CR on input. .IP "\fBINLCRNL" Map NL to CR-NL on input. -.IP "\fBIGNCR" -Ignore CR on input. -.IP "\fBICRNL" -Map CR to NL on input (unless IGNCR is set). -.IP "\fBONLCRNL" -Map NL to CR-NL on output. .IP "\fBOCRNL" Map CR to NL on output. .IP "\fBODELBS" Map DEL to BS on output. +.IP "\fBONLCRNL" +Map NL to CR-NL on output. .P If defining more than one flag, the flags must be comma separated. .RE diff --git a/src/Makefile.in b/src/Makefile.in index 231214b..ee56344 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/src/bash-completion/tio.in b/src/bash-completion/tio.in index 431b1cc..367f4b2 100644 --- a/src/bash-completion/tio.in +++ b/src/bash-completion/tio.in @@ -58,7 +58,7 @@ _tio() return 0 ;; -m | --map) - COMPREPLY=( $(compgen -W "INLCR IGNCR ICRNL ONLCR OCRNL" -- ${cur}) ) + COMPREPLY=( $(compgen -W "ICRNL IGNCR INLCR INLCRNL OCRNL ODELBS ONLCRNL" -- ${cur}) ) return 0 ;; -v | --version) diff --git a/src/tty.c b/src/tty.c index 9ad4980..c823e1b 100644 --- a/src/tty.c +++ b/src/tty.c @@ -55,6 +55,7 @@ static bool standard_baudrate = true; static void (*print)(char c); static int fd; static bool map_inlcrnl = false; +static bool map_onlcrnl = false; static bool map_odelbs = false; #define tio_printf(format, args...) \ @@ -413,14 +414,14 @@ void tty_configure(void) tio.c_iflag |= IGNCR; else if (strcmp(token,"ICRNL") == 0) tio.c_iflag |= ICRNL; - else if (strcmp(token,"ONLCRNL") == 0) - tio.c_oflag |= ONLCR; else if (strcmp(token,"OCRNL") == 0) tio.c_oflag |= OCRNL; else if (strcmp(token,"ODELBS") == 0) map_odelbs = true; else if (strcmp(token,"INLCRNL") == 0) map_inlcrnl = true; + else if (strcmp(token, "ONLCRNL") == 0) + map_onlcrnl = true; else { printf("Error: Unknown mapping flag %s\n", token); @@ -652,6 +653,18 @@ int tty_connect(void) if ((output_char == 127) && (map_odelbs)) output_char = '\b'; + /* Map newline character */ + if ((output_char == '\n') && (map_onlcrnl)) { + char r = '\r'; + + status = write(fd, &r, 1); + if (status < 0) + warning_printf("Could not write to tty device"); + + tx_total++; + delay(option.output_delay); + } + /* Send output to tty device */ status = write(fd, &output_char, 1); if (status < 0) -- 2.39.2