Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Mar 2021 22:47:11 GMT
From:      Stefan Eßer <se@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 456d11526393 - releng/13.0 - Upgrade to version 3.3.0
Message-ID:  <202103082247.128MlBlZ052701@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by se:

URL: https://cgit.FreeBSD.org/src/commit/?id=456d115263939751cd7b878ad039001f6a7e3694

commit 456d115263939751cd7b878ad039001f6a7e3694
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2021-02-17 21:56:16 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2021-03-08 22:46:14 +0000

    Upgrade to version 3.3.0
    
    This update changes the behavior of "-e" or "-f" in BC_ENV_ARGS:
    
    Use of these options on the command line makes bc exit after executing
    the given commands. These options will not cause bc to exit when
    passed via the environment (but EOF in STDIN or -e or -f on the
    command line will make bc exit as before).
    
    The same applies to DC_ENV_ARGS with regard to the dc program.
    
    (cherry picked from commit 9a995fe186257315e7b3d01e24c55d86bb18fd32)
    
    Approved by:   re
---
 contrib/bc/Makefile.in            |  2 +-
 contrib/bc/NEWS.md                | 20 ++++++++++++++++++++
 contrib/bc/README.md              |  2 +-
 contrib/bc/configure.sh           |  7 +------
 contrib/bc/include/args.h         |  2 +-
 contrib/bc/include/status.h       | 10 +++++++---
 contrib/bc/include/vm.h           |  1 +
 contrib/bc/manuals/bc.1.md.in     | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/A.1         | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/A.1.md      | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/E.1         | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/E.1.md      | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/EH.1        | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/EH.1.md     | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/EHN.1       | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/EHN.1.md    | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/EHNP.1      | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/EHNP.1.md   | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/EHP.1       | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/EHP.1.md    | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/EN.1        | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/EN.1.md     | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/ENP.1       | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/ENP.1.md    | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/EP.1        | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/EP.1.md     | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/H.1         | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/H.1.md      | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/HN.1        | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/HN.1.md     | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/HNP.1       | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/HNP.1.md    | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/HP.1        | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/HP.1.md     | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/N.1         | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/N.1.md      | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/NP.1        | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/NP.1.md     | 23 ++++++++++++++++-------
 contrib/bc/manuals/bc/P.1         | 25 +++++++++++++++++++------
 contrib/bc/manuals/bc/P.1.md      | 23 ++++++++++++++++-------
 contrib/bc/manuals/bcl.3          |  2 +-
 contrib/bc/manuals/build.md       | 16 ++++++++++++++++
 contrib/bc/manuals/dc.1.md.in     | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/A.1         | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/A.1.md      | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/E.1         | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/E.1.md      | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/EH.1        | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/EH.1.md     | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/EHN.1       | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/EHN.1.md    | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/EHNP.1      | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/EHNP.1.md   | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/EHP.1       | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/EHP.1.md    | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/EN.1        | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/EN.1.md     | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/ENP.1       | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/ENP.1.md    | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/EP.1        | 27 ++++++++++++++++++++-------
 contrib/bc/manuals/dc/EP.1.md     | 25 +++++++++++++++++--------
 contrib/bc/manuals/dc/H.1         | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/H.1.md      | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/HN.1        | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/HN.1.md     | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/HNP.1       | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/HNP.1.md    | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/HP.1        | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/HP.1.md     | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/N.1         | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/N.1.md      | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/NP.1        | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/NP.1.md     | 27 ++++++++++++++++++---------
 contrib/bc/manuals/dc/P.1         | 29 +++++++++++++++++++++--------
 contrib/bc/manuals/dc/P.1.md      | 27 ++++++++++++++++++---------
 contrib/bc/manuals/header_bc.txt  |  2 +-
 contrib/bc/manuals/header_bcl.txt |  2 +-
 contrib/bc/manuals/header_dc.txt  |  2 +-
 contrib/bc/release.sh             |  2 +-
 contrib/bc/src/args.c             |  4 +++-
 contrib/bc/src/vm.c               |  6 +++---
 contrib/bc/tests/script.sh        |  2 +-
 82 files changed, 1262 insertions(+), 502 deletions(-)

diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in
index 8ae982bd99fe..dbb5debd44cc 100644
--- a/contrib/bc/Makefile.in
+++ b/contrib/bc/Makefile.in
@@ -29,7 +29,7 @@
 #
 .POSIX:
 
-VERSION = 3.2.6
+VERSION = 3.3.0
 
 SRC = %%SRC%%
 OBJ = %%OBJ%%
diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md
index 5982defb754c..6a8899200f4a 100644
--- a/contrib/bc/NEWS.md
+++ b/contrib/bc/NEWS.md
@@ -1,5 +1,25 @@
 # News
 
+## 3.3.0
+
+This is a production release that changes one behavior and fixes documentation
+bugs.
+
+The changed behavior is the treatment of `-e` and `-f` when given through
+`BC_ENV_ARGS` or `DC_ENV_ARGS`. Now `bc` and `dc` do not exit when those options
+(or their equivalents) are given through those environment variables. However,
+`bc` and `dc` still exit when they or their equivalents are given on the
+command-line.
+
+## 3.2.7
+
+This is a production release that removes a small non-portable shell operation
+in `configure.sh`. This problem was only noticed on OpenBSD, not FreeBSD or
+Linux.
+
+Non-OpenBSD users do ***NOT*** need to upgrade, although NetBSD users may also
+need to upgrade.
+
 ## 3.2.6
 
 This is a production release that fixes the build on FreeBSD.
diff --git a/contrib/bc/README.md b/contrib/bc/README.md
index beda88d23f90..2f95e16ed246 100644
--- a/contrib/bc/README.md
+++ b/contrib/bc/README.md
@@ -342,7 +342,7 @@ Folders:
 [20]: https://git.yzena.com/gavin/bc
 [21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/
 [22]: https://www.deepl.com/translator
-[23]: https://svnweb.freebsd.org/base/head/contrib/bc/
+[23]: https://cgit.freebsd.org/src/tree/contrib/bc
 [24]: https://bugs.freebsd.org/
 [25]: https://reviews.freebsd.org/
 [26]: ./manuals/bcl.3.md
diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh
index ae1675cde97d..310c26882906 100755
--- a/contrib/bc/configure.sh
+++ b/contrib/bc/configure.sh
@@ -253,7 +253,7 @@ replace_ext() {
 	_replace_ext_ext1="$2"
 	_replace_ext_ext2="$3"
 
-	_replace_ext_result=${_replace_ext_file%.$_replace_ext_ext1}.$_replace_ext_ext2
+	_replace_ext_result="${_replace_ext_file%.$_replace_ext_ext1}.$_replace_ext_ext2"
 
 	printf '%s\n' "$_replace_ext_result"
 }
@@ -1199,17 +1199,12 @@ SRC_TARGETS=""
 
 src_files=$(find_src_files $unneeded)
 
-temp_ifs="$IFS"
-IFS=$'\n'
-
 for f in $src_files; do
 	o=$(replace_ext "$f" "c" "o")
 	SRC_TARGETS=$(printf '%s\n\n%s: %s %s\n\t$(CC) $(CFLAGS) -o %s -c %s\n' \
 		"$SRC_TARGETS" "$o" "$headers" "$f" "$o" "$f")
 done
 
-IFS="$temp_ifs"
-
 contents=$(replace "$contents" "HEADERS" "$headers")
 
 contents=$(replace "$contents" "BC_ENABLED" "$bc")
diff --git a/contrib/bc/include/args.h b/contrib/bc/include/args.h
index 6b68ed300440..d53785067237 100644
--- a/contrib/bc/include/args.h
+++ b/contrib/bc/include/args.h
@@ -39,7 +39,7 @@
 #include <status.h>
 #include <vm.h>
 
-void bc_args(int argc, char *argv[]);
+void bc_args(int argc, char *argv[], bool exit_exprs);
 
 extern const char* const bc_args_env_name;
 
diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h
index 3fa844485690..cf41a3ce4670 100644
--- a/contrib/bc/include/status.h
+++ b/contrib/bc/include/status.h
@@ -176,11 +176,15 @@ typedef enum BcErr {
 #endif // __STDC_VERSION__
 
 #if defined(__clang__) || defined(__GNUC__)
-#if defined(__has_attribute) && __has_attribute(fallthrough)
+#if defined(__has_attribute)
+#if __has_attribute(fallthrough)
 #define BC_FALLTHROUGH __attribute__((fallthrough));
-#else // defined(__has_attribute) && __has_attribute(fallthrough)
+#else // __has_attribute(fallthrough)
 #define BC_FALLTHROUGH
-#endif // defined(__has_attribute) && __has_attribute(fallthrough)
+#endif // __has_attribute(fallthrough)
+#else // defined(__has_attribute)
+#define BC_FALLTHROUGH
+#endif // defined(__has_attribute)
 #else // defined(__clang__) || defined(__GNUC__)
 #define BC_FALLTHROUGH
 #endif // defined(__clang__) || defined(__GNUC__)
diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h
index 8b0babff4d81..80a060edd42f 100644
--- a/contrib/bc/include/vm.h
+++ b/contrib/bc/include/vm.h
@@ -356,6 +356,7 @@ typedef struct BcVm {
 	uint16_t line_len;
 
 	bool no_exit_exprs;
+	bool exit_exprs;
 	bool eof;
 #endif // !BC_ENABLE_LIBRARY
 
diff --git a/contrib/bc/manuals/bc.1.md.in b/contrib/bc/manuals/bc.1.md.in
index 624ea3fb54ab..1ce83b8237cd 100644
--- a/contrib/bc/manuals/bc.1.md.in
+++ b/contrib/bc/manuals/bc.1.md.in
@@ -229,10 +229,13 @@ The following are the options that bc(1) accepts.
     evaluated in the order given. This means that if a file is given before an
     expression, the file is read in and evaluated first.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
-    However, if any other **-e**, **--expression**, **-f**, or **--file**
-    arguments are given after that, bc(1) will give a fatal error and exit.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**, whether on the
+    command-line or in **BC_ENV_ARGS**. However, if any other **-e**,
+    **--expression**, **-f**, or **--file** arguments are given after **-f-** or
+    equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -242,8 +245,12 @@ The following are the options that bc(1) accepts.
     through **stdin**. If expressions are also given (see above), the
     expressions are evaluated in the order given.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**. However, if any other
+    **-e**, **--expression**, **-f**, or **--file** arguments are given after
+    **-f-** or equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -251,7 +258,9 @@ All long options are **non-portable extensions**.
 
 # STDOUT
 
-Any non-error output is written to **stdout**.
+Any non-error output is written to **stdout**. In addition, if history (see the
+**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled,
+both are output to **stdout**.
 
 **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal
 error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if
diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1
index da35e8c7eaee..d1e80769c855 100644
--- a/contrib/bc/manuals/bc/A.1
+++ b/contrib/bc/manuals/bc/A.1
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
 .SH NAME
 .PP
 bc - arbitrary-precision decimal arithmetic language and calculator
@@ -230,12 +230,16 @@ This means that if a file is given before an expression, the file is
 read in and evaluated first.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
-\f[B]-f\f[R] or \f[B]\[en]file\f[R].
+\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
+\f[B]BC_ENV_ARGS\f[R].
 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
-\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that,
-bc(1) will give a fatal error and exit.
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -247,9 +251,15 @@ If expressions are also given (see above), the expressions are evaluated
 in the order given.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
 \f[B]-f\f[R] or \f[B]\[en]file\f[R].
+However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -258,6 +268,9 @@ All long options are \f[B]non-portable extensions\f[R].
 .SH STDOUT
 .PP
 Any non-error output is written to \f[B]stdout\f[R].
+In addition, if history (see the \f[B]HISTORY\f[R] section) and the
+prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output
+to \f[B]stdout\f[R].
 .PP
 \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will
 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md
index 293a21ad0259..0cf7a4a0d70e 100644
--- a/contrib/bc/manuals/bc/A.1.md
+++ b/contrib/bc/manuals/bc/A.1.md
@@ -187,10 +187,13 @@ The following are the options that bc(1) accepts.
     evaluated in the order given. This means that if a file is given before an
     expression, the file is read in and evaluated first.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
-    However, if any other **-e**, **--expression**, **-f**, or **--file**
-    arguments are given after that, bc(1) will give a fatal error and exit.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**, whether on the
+    command-line or in **BC_ENV_ARGS**. However, if any other **-e**,
+    **--expression**, **-f**, or **--file** arguments are given after **-f-** or
+    equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -200,8 +203,12 @@ The following are the options that bc(1) accepts.
     through **stdin**. If expressions are also given (see above), the
     expressions are evaluated in the order given.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**. However, if any other
+    **-e**, **--expression**, **-f**, or **--file** arguments are given after
+    **-f-** or equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -209,7 +216,9 @@ All long options are **non-portable extensions**.
 
 # STDOUT
 
-Any non-error output is written to **stdout**.
+Any non-error output is written to **stdout**. In addition, if history (see the
+**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled,
+both are output to **stdout**.
 
 **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal
 error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if
diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1
index 02a56e6c653c..597cde782788 100644
--- a/contrib/bc/manuals/bc/E.1
+++ b/contrib/bc/manuals/bc/E.1
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
 .SH NAME
 .PP
 bc - arbitrary-precision decimal arithmetic language and calculator
@@ -192,12 +192,16 @@ This means that if a file is given before an expression, the file is
 read in and evaluated first.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
-\f[B]-f\f[R] or \f[B]\[en]file\f[R].
+\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
+\f[B]BC_ENV_ARGS\f[R].
 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
-\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that,
-bc(1) will give a fatal error and exit.
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -209,9 +213,15 @@ If expressions are also given (see above), the expressions are evaluated
 in the order given.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
 \f[B]-f\f[R] or \f[B]\[en]file\f[R].
+However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -220,6 +230,9 @@ All long options are \f[B]non-portable extensions\f[R].
 .SH STDOUT
 .PP
 Any non-error output is written to \f[B]stdout\f[R].
+In addition, if history (see the \f[B]HISTORY\f[R] section) and the
+prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output
+to \f[B]stdout\f[R].
 .PP
 \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will
 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
diff --git a/contrib/bc/manuals/bc/E.1.md b/contrib/bc/manuals/bc/E.1.md
index 7cbc1a56548a..864cf32068bf 100644
--- a/contrib/bc/manuals/bc/E.1.md
+++ b/contrib/bc/manuals/bc/E.1.md
@@ -171,10 +171,13 @@ The following are the options that bc(1) accepts.
     evaluated in the order given. This means that if a file is given before an
     expression, the file is read in and evaluated first.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
-    However, if any other **-e**, **--expression**, **-f**, or **--file**
-    arguments are given after that, bc(1) will give a fatal error and exit.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**, whether on the
+    command-line or in **BC_ENV_ARGS**. However, if any other **-e**,
+    **--expression**, **-f**, or **--file** arguments are given after **-f-** or
+    equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -184,8 +187,12 @@ The following are the options that bc(1) accepts.
     through **stdin**. If expressions are also given (see above), the
     expressions are evaluated in the order given.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**. However, if any other
+    **-e**, **--expression**, **-f**, or **--file** arguments are given after
+    **-f-** or equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -193,7 +200,9 @@ All long options are **non-portable extensions**.
 
 # STDOUT
 
-Any non-error output is written to **stdout**.
+Any non-error output is written to **stdout**. In addition, if history (see the
+**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled,
+both are output to **stdout**.
 
 **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal
 error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if
diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1
index 8cb2a3bc8335..dca77a99162e 100644
--- a/contrib/bc/manuals/bc/EH.1
+++ b/contrib/bc/manuals/bc/EH.1
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
 .SH NAME
 .PP
 bc - arbitrary-precision decimal arithmetic language and calculator
@@ -189,12 +189,16 @@ This means that if a file is given before an expression, the file is
 read in and evaluated first.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
-\f[B]-f\f[R] or \f[B]\[en]file\f[R].
+\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
+\f[B]BC_ENV_ARGS\f[R].
 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
-\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that,
-bc(1) will give a fatal error and exit.
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -206,9 +210,15 @@ If expressions are also given (see above), the expressions are evaluated
 in the order given.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
 \f[B]-f\f[R] or \f[B]\[en]file\f[R].
+However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -217,6 +227,9 @@ All long options are \f[B]non-portable extensions\f[R].
 .SH STDOUT
 .PP
 Any non-error output is written to \f[B]stdout\f[R].
+In addition, if history (see the \f[B]HISTORY\f[R] section) and the
+prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output
+to \f[B]stdout\f[R].
 .PP
 \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will
 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
diff --git a/contrib/bc/manuals/bc/EH.1.md b/contrib/bc/manuals/bc/EH.1.md
index 351882878cd3..c1e324ab6ebc 100644
--- a/contrib/bc/manuals/bc/EH.1.md
+++ b/contrib/bc/manuals/bc/EH.1.md
@@ -168,10 +168,13 @@ The following are the options that bc(1) accepts.
     evaluated in the order given. This means that if a file is given before an
     expression, the file is read in and evaluated first.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
-    However, if any other **-e**, **--expression**, **-f**, or **--file**
-    arguments are given after that, bc(1) will give a fatal error and exit.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**, whether on the
+    command-line or in **BC_ENV_ARGS**. However, if any other **-e**,
+    **--expression**, **-f**, or **--file** arguments are given after **-f-** or
+    equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -181,8 +184,12 @@ The following are the options that bc(1) accepts.
     through **stdin**. If expressions are also given (see above), the
     expressions are evaluated in the order given.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**. However, if any other
+    **-e**, **--expression**, **-f**, or **--file** arguments are given after
+    **-f-** or equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -190,7 +197,9 @@ All long options are **non-portable extensions**.
 
 # STDOUT
 
-Any non-error output is written to **stdout**.
+Any non-error output is written to **stdout**. In addition, if history (see the
+**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled,
+both are output to **stdout**.
 
 **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal
 error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if
diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1
index f751f9d31beb..6b208ade85fd 100644
--- a/contrib/bc/manuals/bc/EHN.1
+++ b/contrib/bc/manuals/bc/EHN.1
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
 .SH NAME
 .PP
 bc - arbitrary-precision decimal arithmetic language and calculator
@@ -189,12 +189,16 @@ This means that if a file is given before an expression, the file is
 read in and evaluated first.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
-\f[B]-f\f[R] or \f[B]\[en]file\f[R].
+\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
+\f[B]BC_ENV_ARGS\f[R].
 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
-\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that,
-bc(1) will give a fatal error and exit.
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -206,9 +210,15 @@ If expressions are also given (see above), the expressions are evaluated
 in the order given.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
 \f[B]-f\f[R] or \f[B]\[en]file\f[R].
+However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -217,6 +227,9 @@ All long options are \f[B]non-portable extensions\f[R].
 .SH STDOUT
 .PP
 Any non-error output is written to \f[B]stdout\f[R].
+In addition, if history (see the \f[B]HISTORY\f[R] section) and the
+prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output
+to \f[B]stdout\f[R].
 .PP
 \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will
 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
diff --git a/contrib/bc/manuals/bc/EHN.1.md b/contrib/bc/manuals/bc/EHN.1.md
index dfe1c401970f..4ee01a4bbcc8 100644
--- a/contrib/bc/manuals/bc/EHN.1.md
+++ b/contrib/bc/manuals/bc/EHN.1.md
@@ -168,10 +168,13 @@ The following are the options that bc(1) accepts.
     evaluated in the order given. This means that if a file is given before an
     expression, the file is read in and evaluated first.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
-    However, if any other **-e**, **--expression**, **-f**, or **--file**
-    arguments are given after that, bc(1) will give a fatal error and exit.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**, whether on the
+    command-line or in **BC_ENV_ARGS**. However, if any other **-e**,
+    **--expression**, **-f**, or **--file** arguments are given after **-f-** or
+    equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -181,8 +184,12 @@ The following are the options that bc(1) accepts.
     through **stdin**. If expressions are also given (see above), the
     expressions are evaluated in the order given.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**. However, if any other
+    **-e**, **--expression**, **-f**, or **--file** arguments are given after
+    **-f-** or equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -190,7 +197,9 @@ All long options are **non-portable extensions**.
 
 # STDOUT
 
-Any non-error output is written to **stdout**.
+Any non-error output is written to **stdout**. In addition, if history (see the
+**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled,
+both are output to **stdout**.
 
 **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal
 error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if
diff --git a/contrib/bc/manuals/bc/EHNP.1 b/contrib/bc/manuals/bc/EHNP.1
index e25cd1a7da42..7bd46f38e104 100644
--- a/contrib/bc/manuals/bc/EHNP.1
+++ b/contrib/bc/manuals/bc/EHNP.1
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
 .SH NAME
 .PP
 bc - arbitrary-precision decimal arithmetic language and calculator
@@ -184,12 +184,16 @@ This means that if a file is given before an expression, the file is
 read in and evaluated first.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
-\f[B]-f\f[R] or \f[B]\[en]file\f[R].
+\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
+\f[B]BC_ENV_ARGS\f[R].
 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
-\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that,
-bc(1) will give a fatal error and exit.
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -201,9 +205,15 @@ If expressions are also given (see above), the expressions are evaluated
 in the order given.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
 \f[B]-f\f[R] or \f[B]\[en]file\f[R].
+However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -212,6 +222,9 @@ All long options are \f[B]non-portable extensions\f[R].
 .SH STDOUT
 .PP
 Any non-error output is written to \f[B]stdout\f[R].
+In addition, if history (see the \f[B]HISTORY\f[R] section) and the
+prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output
+to \f[B]stdout\f[R].
 .PP
 \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will
 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
diff --git a/contrib/bc/manuals/bc/EHNP.1.md b/contrib/bc/manuals/bc/EHNP.1.md
index e55673769736..8aca89e6f7b0 100644
--- a/contrib/bc/manuals/bc/EHNP.1.md
+++ b/contrib/bc/manuals/bc/EHNP.1.md
@@ -164,10 +164,13 @@ The following are the options that bc(1) accepts.
     evaluated in the order given. This means that if a file is given before an
     expression, the file is read in and evaluated first.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
-    However, if any other **-e**, **--expression**, **-f**, or **--file**
-    arguments are given after that, bc(1) will give a fatal error and exit.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**, whether on the
+    command-line or in **BC_ENV_ARGS**. However, if any other **-e**,
+    **--expression**, **-f**, or **--file** arguments are given after **-f-** or
+    equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -177,8 +180,12 @@ The following are the options that bc(1) accepts.
     through **stdin**. If expressions are also given (see above), the
     expressions are evaluated in the order given.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**. However, if any other
+    **-e**, **--expression**, **-f**, or **--file** arguments are given after
+    **-f-** or equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -186,7 +193,9 @@ All long options are **non-portable extensions**.
 
 # STDOUT
 
-Any non-error output is written to **stdout**.
+Any non-error output is written to **stdout**. In addition, if history (see the
+**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled,
+both are output to **stdout**.
 
 **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal
 error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if
diff --git a/contrib/bc/manuals/bc/EHP.1 b/contrib/bc/manuals/bc/EHP.1
index 7f35d1a1be7f..31c02f1b9591 100644
--- a/contrib/bc/manuals/bc/EHP.1
+++ b/contrib/bc/manuals/bc/EHP.1
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
 .SH NAME
 .PP
 bc - arbitrary-precision decimal arithmetic language and calculator
@@ -184,12 +184,16 @@ This means that if a file is given before an expression, the file is
 read in and evaluated first.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
-\f[B]-f\f[R] or \f[B]\[en]file\f[R].
+\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
+\f[B]BC_ENV_ARGS\f[R].
 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
-\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that,
-bc(1) will give a fatal error and exit.
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -201,9 +205,15 @@ If expressions are also given (see above), the expressions are evaluated
 in the order given.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
 \f[B]-f\f[R] or \f[B]\[en]file\f[R].
+However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -212,6 +222,9 @@ All long options are \f[B]non-portable extensions\f[R].
 .SH STDOUT
 .PP
 Any non-error output is written to \f[B]stdout\f[R].
+In addition, if history (see the \f[B]HISTORY\f[R] section) and the
+prompt (see the \f[B]TTY MODE\f[R] section) are enabled, both are output
+to \f[B]stdout\f[R].
 .PP
 \f[B]Note\f[R]: Unlike other bc(1) implementations, this bc(1) will
 issue a fatal error (see the \f[B]EXIT STATUS\f[R] section) if it cannot
diff --git a/contrib/bc/manuals/bc/EHP.1.md b/contrib/bc/manuals/bc/EHP.1.md
index 11050003420f..2c9ab3909dd6 100644
--- a/contrib/bc/manuals/bc/EHP.1.md
+++ b/contrib/bc/manuals/bc/EHP.1.md
@@ -164,10 +164,13 @@ The following are the options that bc(1) accepts.
     evaluated in the order given. This means that if a file is given before an
     expression, the file is read in and evaluated first.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
-    However, if any other **-e**, **--expression**, **-f**, or **--file**
-    arguments are given after that, bc(1) will give a fatal error and exit.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**, whether on the
+    command-line or in **BC_ENV_ARGS**. However, if any other **-e**,
+    **--expression**, **-f**, or **--file** arguments are given after **-f-** or
+    equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -177,8 +180,12 @@ The following are the options that bc(1) accepts.
     through **stdin**. If expressions are also given (see above), the
     expressions are evaluated in the order given.
 
-    After processing all expressions and files, bc(1) will exit, unless **-**
-    (**stdin**) was given as an argument at least once to **-f** or **--file**.
+    If this option is given on the command-line (i.e., not in **BC_ENV_ARGS**,
+    see the **ENVIRONMENT VARIABLES** section), then after processing all
+    expressions and files, bc(1) will exit, unless **-** (**stdin**) was given
+    as an argument at least once to **-f** or **--file**. However, if any other
+    **-e**, **--expression**, **-f**, or **--file** arguments are given after
+    **-f-** or equivalent is given, bc(1) will give a fatal error and exit.
 
     This is a **non-portable extension**.
 
@@ -186,7 +193,9 @@ All long options are **non-portable extensions**.
 
 # STDOUT
 
-Any non-error output is written to **stdout**.
+Any non-error output is written to **stdout**. In addition, if history (see the
+**HISTORY** section) and the prompt (see the **TTY MODE** section) are enabled,
+both are output to **stdout**.
 
 **Note**: Unlike other bc(1) implementations, this bc(1) will issue a fatal
 error (see the **EXIT STATUS** section) if it cannot write to **stdout**, so if
diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1
index c8e3a327b2f8..faa6bf488e28 100644
--- a/contrib/bc/manuals/bc/EN.1
+++ b/contrib/bc/manuals/bc/EN.1
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2021" "Gavin D. Howard" "General Commands Manual"
 .SH NAME
 .PP
 bc - arbitrary-precision decimal arithmetic language and calculator
@@ -192,12 +192,16 @@ This means that if a file is given before an expression, the file is
 read in and evaluated first.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
+then after processing all expressions and files, bc(1) will exit, unless
 \f[B]-\f[R] (\f[B]stdin\f[R]) was given as an argument at least once to
-\f[B]-f\f[R] or \f[B]\[en]file\f[R].
+\f[B]-f\f[R] or \f[B]\[en]file\f[R], whether on the command-line or in
+\f[B]BC_ENV_ARGS\f[R].
 However, if any other \f[B]-e\f[R], \f[B]\[en]expression\f[R],
-\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after that,
-bc(1) will give a fatal error and exit.
+\f[B]-f\f[R], or \f[B]\[en]file\f[R] arguments are given after
+\f[B]-f-\f[R] or equivalent is given, bc(1) will give a fatal error and
+exit.
 .PP
 This is a \f[B]non-portable extension\f[R].
 .RE
@@ -209,9 +213,15 @@ If expressions are also given (see above), the expressions are evaluated
 in the order given.
 .RS
 .PP
-After processing all expressions and files, bc(1) will exit, unless
+If this option is given on the command-line (i.e., not in
+\f[B]BC_ENV_ARGS\f[R], see the \f[B]ENVIRONMENT VARIABLES\f[R] section),
*** 3438 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103082247.128MlBlZ052701>