From 49b387bb53e76eecd2b6cf4f89f3146fc2198bd3 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 24 Nov 2020 17:56:57 +0000 Subject: Fix chomping: only make it default on line-processing binaries --- NEWS | 4 ++++ doc/backtick.html | 6 +++--- doc/define.html | 2 +- doc/el_transform.html | 22 +++++++++++++------- doc/forbacktickx.html | 34 +++++++++++++++++++++++------- doc/forstdin.html | 41 +++++++++++++++++++++++++------------ doc/importas.html | 2 +- doc/multidefine.html | 4 +++- doc/multisubstitute.html | 4 ++-- doc/redirfd.html | 8 ++------ doc/upgrade.html | 7 ++++++- doc/withstdinas.html | 5 +++-- src/execline/backtick.c | 7 ++++--- src/execline/define.c | 2 +- src/execline/forbacktickx.c | 16 +++++++-------- src/execline/forstdin.c | 12 ++++++----- src/execline/forx.c | 3 +-- src/execline/ifthenelse.c | 2 +- src/execline/importas.c | 2 +- src/execline/multidefine.c | 2 +- src/execline/redirfd.c | 6 +++--- src/execline/tryexec.c | 2 +- src/execline/withstdinas.c | 7 ++++--- src/libexecline/exlsn_define.c | 3 ++- src/libexecline/exlsn_importas.c | 3 ++- src/libexecline/exlsn_multidefine.c | 3 ++- 26 files changed, 132 insertions(+), 77 deletions(-) diff --git a/NEWS b/NEWS index 7ef56a9..8058b77 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ In 2.7.0.0 - forstdin QoL changes: now it exits 1 if it doesn't read anything, and it only splits on newlines by default. + - forbacktickx, which is a wrapper to forstdin, gets the same changes. + - Line-processing binaries now chomp by default. Substitution +binaries do not. + - New -N option everywhere to disable chomping. - New "default" directive to trap, replacing the irrelevant "timeout". diff --git a/doc/backtick.html b/doc/backtick.html index b1e2870..1f77432 100644 --- a/doc/backtick.html +++ b/doc/backtick.html @@ -30,7 +30,7 @@ environment variable, then executes another program.

-     backtick [ -i | -I | -D default ] [ -n ] variable { prog1... } prog2...
+     backtick [ -i | -I | -D default ] [ -N | -n ] variable { prog1... } prog2...