svn commit: r364052 - in stable/12: contrib/bc contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/manuals/bc contrib/bc/manuals/dc contrib/bc/src contrib/bc/src/bc contrib/bc/src/d...

Stefan Eßer se at FreeBSD.org
Sat Aug 8 16:41:33 UTC 2020


Author: se
Date: Sat Aug  8 16:41:28 2020
New Revision: 364052
URL: https://svnweb.freebsd.org/changeset/base/364052

Log:
  MFC: 362681, 362697, 362914, 362984, 362986, 362987, 363091, 363172, 363809,
       363810, 363811, 363915
  
  Import new 2-clause BSD licenced implementation of the bc and dc commands
  
  These implementations of the bc and dc programs offer a number of advantages
  compared to the current implementations in the FreeBSD base system:
  
  - They do not depend on external large number functions (i.e. no dependency
    on OpenSSL or any other large-number library)
  
  - They implements all features found in GNU bc/dc (with the exception of
    the forking of sub-processes in dc, which the author of this version
    considers a security issue).
  
  - They are significantly faster than the current code in base (more than
    2 orders of magnitude in some of my tests, e.g. for 12345^100000).
  
  - They should be fully compatible with all features and the behavior of the
    current implementations in FreeBSD (not formally verified).
  
  - They support POSIX message catalogs and come with localized messages in
    Chinese, Dutch, English, French, German, Japanese, Polish, Portuguese,
    and Russian.
  
  - They offer very detailed man-pages that provide far more information than
    the current ones.
  
  This code is not built and installed in FreeBSD-12, unless WITH_GH_BC=yes
  is set (e.g. in src.conf) during builworld and installworld. It has been
  imported and made the default in FreeBSD-CURRENT, and all improvements and
  changes requested for the version in -CURRENT are included in this initial
  import into a stable branch.

Added:
  stable/12/contrib/bc/
     - copied from r362987, head/contrib/bc/
  stable/12/contrib/bc/tests/bc/misc6.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/misc6.txt
  stable/12/contrib/bc/tests/bc/misc6_results.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/misc6_results.txt
  stable/12/contrib/bc/tests/bc/misc7.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/misc7.txt
  stable/12/contrib/bc/tests/bc/misc7_results.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/misc7_results.txt
  stable/12/contrib/bc/tests/bc/stdin1.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/stdin1.txt
  stable/12/contrib/bc/tests/bc/stdin1_results.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/stdin1_results.txt
  stable/12/contrib/bc/tests/bc/stdin2.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/stdin2.txt
  stable/12/contrib/bc/tests/bc/stdin2_results.txt
     - copied unchanged from r363810, head/contrib/bc/tests/bc/stdin2_results.txt
  stable/12/usr.bin/gh-bc/
     - copied from r362681, head/usr.bin/gh-bc/
  stable/12/usr.bin/gh-bc/tests/
     - copied from r363811, head/usr.bin/gh-bc/tests/
Modified:
  stable/12/contrib/bc/Makefile.in
  stable/12/contrib/bc/NEWS.md
  stable/12/contrib/bc/README.md
  stable/12/contrib/bc/configure.sh
  stable/12/contrib/bc/include/bc.h
  stable/12/contrib/bc/include/vm.h
  stable/12/contrib/bc/locale_install.sh
  stable/12/contrib/bc/locale_uninstall.sh
  stable/12/contrib/bc/locales/zh_CN.GB18030.msg
  stable/12/contrib/bc/locales/zh_CN.GB2312.msg
  stable/12/contrib/bc/locales/zh_CN.GBK.msg
  stable/12/contrib/bc/locales/zh_CN.UTF-8.msg
  stable/12/contrib/bc/locales/zh_CN.eucCN.msg
  stable/12/contrib/bc/manuals/bc.1.md.in
  stable/12/contrib/bc/manuals/bc/A.1
  stable/12/contrib/bc/manuals/bc/A.1.md
  stable/12/contrib/bc/manuals/bc/E.1
  stable/12/contrib/bc/manuals/bc/E.1.md
  stable/12/contrib/bc/manuals/bc/EH.1
  stable/12/contrib/bc/manuals/bc/EH.1.md
  stable/12/contrib/bc/manuals/bc/EHN.1
  stable/12/contrib/bc/manuals/bc/EHN.1.md
  stable/12/contrib/bc/manuals/bc/EHNP.1
  stable/12/contrib/bc/manuals/bc/EHNP.1.md
  stable/12/contrib/bc/manuals/bc/EHP.1
  stable/12/contrib/bc/manuals/bc/EHP.1.md
  stable/12/contrib/bc/manuals/bc/EN.1
  stable/12/contrib/bc/manuals/bc/EN.1.md
  stable/12/contrib/bc/manuals/bc/ENP.1
  stable/12/contrib/bc/manuals/bc/ENP.1.md
  stable/12/contrib/bc/manuals/bc/EP.1
  stable/12/contrib/bc/manuals/bc/EP.1.md
  stable/12/contrib/bc/manuals/bc/H.1
  stable/12/contrib/bc/manuals/bc/H.1.md
  stable/12/contrib/bc/manuals/bc/HN.1
  stable/12/contrib/bc/manuals/bc/HN.1.md
  stable/12/contrib/bc/manuals/bc/HNP.1
  stable/12/contrib/bc/manuals/bc/HNP.1.md
  stable/12/contrib/bc/manuals/bc/HP.1
  stable/12/contrib/bc/manuals/bc/HP.1.md
  stable/12/contrib/bc/manuals/bc/N.1
  stable/12/contrib/bc/manuals/bc/N.1.md
  stable/12/contrib/bc/manuals/bc/NP.1
  stable/12/contrib/bc/manuals/bc/NP.1.md
  stable/12/contrib/bc/manuals/bc/P.1
  stable/12/contrib/bc/manuals/bc/P.1.md
  stable/12/contrib/bc/manuals/build.md
  stable/12/contrib/bc/manuals/dc.1.md.in
  stable/12/contrib/bc/manuals/dc/A.1
  stable/12/contrib/bc/manuals/dc/A.1.md
  stable/12/contrib/bc/manuals/dc/E.1
  stable/12/contrib/bc/manuals/dc/E.1.md
  stable/12/contrib/bc/manuals/dc/EH.1
  stable/12/contrib/bc/manuals/dc/EH.1.md
  stable/12/contrib/bc/manuals/dc/EHN.1
  stable/12/contrib/bc/manuals/dc/EHN.1.md
  stable/12/contrib/bc/manuals/dc/EHNP.1
  stable/12/contrib/bc/manuals/dc/EHNP.1.md
  stable/12/contrib/bc/manuals/dc/EHP.1
  stable/12/contrib/bc/manuals/dc/EHP.1.md
  stable/12/contrib/bc/manuals/dc/EN.1
  stable/12/contrib/bc/manuals/dc/EN.1.md
  stable/12/contrib/bc/manuals/dc/ENP.1
  stable/12/contrib/bc/manuals/dc/ENP.1.md
  stable/12/contrib/bc/manuals/dc/EP.1
  stable/12/contrib/bc/manuals/dc/EP.1.md
  stable/12/contrib/bc/manuals/dc/H.1
  stable/12/contrib/bc/manuals/dc/H.1.md
  stable/12/contrib/bc/manuals/dc/HN.1
  stable/12/contrib/bc/manuals/dc/HN.1.md
  stable/12/contrib/bc/manuals/dc/HNP.1
  stable/12/contrib/bc/manuals/dc/HNP.1.md
  stable/12/contrib/bc/manuals/dc/HP.1
  stable/12/contrib/bc/manuals/dc/HP.1.md
  stable/12/contrib/bc/manuals/dc/N.1
  stable/12/contrib/bc/manuals/dc/N.1.md
  stable/12/contrib/bc/manuals/dc/NP.1
  stable/12/contrib/bc/manuals/dc/NP.1.md
  stable/12/contrib/bc/manuals/dc/P.1
  stable/12/contrib/bc/manuals/dc/P.1.md
  stable/12/contrib/bc/src/args.c
  stable/12/contrib/bc/src/bc/bc.c
  stable/12/contrib/bc/src/bc/parse.c
  stable/12/contrib/bc/src/dc/dc.c
  stable/12/contrib/bc/src/program.c
  stable/12/contrib/bc/src/vm.c
  stable/12/contrib/bc/tests/bc/all.txt
  stable/12/contrib/bc/tests/bc/stdin.txt
  stable/12/contrib/bc/tests/bc/stdin_results.txt
  stable/12/contrib/bc/tests/stdin.sh
  stable/12/etc/mtree/BSD.tests.dist
  stable/12/share/mk/src.opts.mk
  stable/12/usr.bin/Makefile
  stable/12/usr.bin/gh-bc/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/bc/Makefile.in
==============================================================================
--- head/contrib/bc/Makefile.in	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/Makefile.in	Sat Aug  8 16:41:28 2020	(r364052)
@@ -29,7 +29,7 @@
 #
 .POSIX:
 
-VERSION = 3.1.1
+VERSION = 3.1.5
 
 SRC = %%SRC%%
 OBJ = %%OBJ%%
@@ -335,7 +335,7 @@ clean_tests: clean clean_config clean_coverage
 	@$(RM) -f bc.old
 
 install_locales:
-	$(LOCALE_INSTALL) $(NLSPATH) $(MAIN_EXEC) $(DESTDIR)
+	%%INSTALL_LOCALES%%
 
 install_bc_manpage:
 	$(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME)

Modified: stable/12/contrib/bc/NEWS.md
==============================================================================
--- head/contrib/bc/NEWS.md	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/NEWS.md	Sat Aug  8 16:41:28 2020	(r364052)
@@ -1,5 +1,52 @@
 # News
 
+## 3.1.5
+
+This is a production release that fixes the Chinese locales (which caused `bc`
+to crash) and a crash caused by `bc` executing code when it should not have been
+able to.
+
+***ALL USERS SHOULD UPGRADE.***
+
+## 3.1.4
+
+This is a production release that fixes one bug, changes two behaviors, and
+removes one environment variable.
+
+The bug is like the one in the last release except it applies if files are being
+executed. I also made the fix more general.
+
+The behavior that was changed is that `bc` now exits when given `-e`, `-f`,
+`--expression` or `--file`. However, if the last one of those is `-f-` (using
+`stdin` as the file), `bc` does not exit. If `-f-` exists and is not the last of
+the `-e` and `-f` options (and equivalents), `bc` gives a fatal error and exits.
+
+Next, I removed the `BC_EXPR_EXIT` and `DC_EXPR_EXIT` environment variables
+since their use is not needed with the behavior change.
+
+Finally, I made it so `bc` does not print the header, though the `-q` and
+`--quiet` options were kept for compatibility with GNU `bc`.
+
+## 3.1.3
+
+This is a production release that fixes one minor bug: if `bc` was invoked like
+the following, it would error:
+
+```
+echo "if (1 < 3) 1" | bc
+```
+
+Unless users run into this bug, they do not need to upgrade, but it is suggested
+that they do.
+
+## 3.1.2
+
+This is a production release that adds a way to install *all* locales. Users do
+***NOT*** need to upgrade.
+
+For package maintainers wishing to make use of the change, just pass `-l` to
+`configure.sh`.
+
 ## 3.1.1
 
 This is a production release that adds two Spanish locales. Users do ***NOT***

Modified: stable/12/contrib/bc/README.md
==============================================================================
--- head/contrib/bc/README.md	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/README.md	Sat Aug  8 16:41:28 2020	(r364052)
@@ -262,8 +262,8 @@ Other projects based on this bc are:
   toybox `bc` should be reported there.
 
 * [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better
-  to report bugs there, and the maintainers of the package will contact me if
-  necessary.
+  to [report bugs there][24], as well as [submit patches][25], and the
+  maintainers of the package will contact me if necessary.
 
 ## Language
 
@@ -332,4 +332,6 @@ 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://github.com/freebsd/freebsd/tree/master/contrib/bc
+[23]: https://svnweb.freebsd.org/base/head/contrib/bc/
+[24]: https://bugs.freebsd.org/
+[25]: https://reviews.freebsd.org/

Modified: stable/12/contrib/bc/configure.sh
==============================================================================
--- head/contrib/bc/configure.sh	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/configure.sh	Sat Aug  8 16:41:28 2020	(r364052)
@@ -47,12 +47,12 @@ usage() {
 
 	printf 'usage: %s -h\n' "$script"
 	printf '       %s --help\n' "$script"
-	printf '       %s [-bD|-dB|-c] [-EfgGHMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script"
+	printf '       %s [-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script"
 	printf '       %s \\\n' "$script"
 	printf '           [--bc-only --disable-dc|--dc-only --disable-bc|--coverage]      \\\n'
 	printf '           [--debug --disable-extra-math --disable-generated-tests]        \\\n'
 	printf '           [--disable-history --disable-man-pages --disable-nls]           \\\n'
-	printf '           [--disable-prompt --disable-strip]                              \\\n'
+	printf '           [--disable-prompt --disable-strip] [--install-all-locales]      \\\n'
 	printf '           [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN]               \\\n'
 	printf '           [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n'
 	printf '           [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR]       \\\n'
@@ -98,6 +98,10 @@ usage() {
 	printf '    -k KARATSUBA_LEN, --karatsuba-len KARATSUBA_LEN\n'
 	printf '        Set the karatsuba length to KARATSUBA_LEN (default is 64).\n'
 	printf '        It is an error if KARATSUBA_LEN is not a number or is less than 16.\n'
+	printf '    -l, --install-all-locales\n'
+	printf '        Installs all locales, regardless of how many are on the system. This\n'
+	printf '        option is useful for package maintainers who want to make sure that\n'
+	printf '        a package contains all of the locales that end users might need.\n'
 	printf '    -M, --disable-man-pages\n'
 	printf '        Disable installing manpages.\n'
 	printf '    -N, --disable-nls\n'
@@ -319,8 +323,9 @@ nls=1
 prompt=1
 force=0
 strip_bin=1
+all_locales=0
 
-while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do
+while getopts "bBcdDEfgGhHk:lMNO:PST-" opt; do
 
 	case "$opt" in
 		b) bc_only=1 ;;
@@ -335,6 +340,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do
 		h) usage ;;
 		H) hist=0 ;;
 		k) karatsuba_len="$OPTARG" ;;
+		l) all_locales=1 ;;
 		M) install_manpages=0 ;;
 		N) nls=0 ;;
 		O) optimization="$OPTARG" ;;
@@ -423,6 +429,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do
 				disable-nls) nls=0 ;;
 				disable-prompt) prompt=0 ;;
 				disable-strip) strip_bin=0 ;;
+				install-all-locales) all_locales=1 ;;
 				help* | bc-only* | dc-only* | coverage* | debug*)
 					usage "No arg allowed for --$arg option" ;;
 				disable-bc* | disable-dc* | disable-extra-math*)
@@ -431,6 +438,8 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do
 					usage "No arg allowed for --$arg option" ;;
 				disable-man-pages* | disable-nls* | disable-strip*)
 					usage "No arg allowed for --$arg option" ;;
+				install-all-locales*)
+					usage "No arg allowed for --$arg option" ;;
 				'') break ;; # "--" terminates argument processing
 				* ) usage "Invalid option $LONG_OPTARG" ;;
 			esac
@@ -751,8 +760,15 @@ if [ "$nls" -ne 0 ]; then
 else
 	install_locales_prereqs=""
 	uninstall_locales_prereqs=""
+	all_locales=0
 fi
 
+if [ "$nls" -ne 0 ] && [ "$all_locales" -ne 0 ]; then
+	install_locales="\$(LOCALE_INSTALL) -l \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)"
+else
+	install_locales="\$(LOCALE_INSTALL) \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)"
+fi
+
 if [ "$hist" -eq 1 ]; then
 
 	set +e
@@ -911,6 +927,7 @@ contents=$(replace "$contents" "HOSTCC" "$HOSTCC")
 contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT")
 contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS")
 contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs")
+contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales")
 contents=$(replace "$contents" "INSTALL_LOCALES_PREREQS" "$install_locales_prereqs")
 contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs")
 contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs")

Modified: stable/12/contrib/bc/include/bc.h
==============================================================================
--- head/contrib/bc/include/bc.h	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/include/bc.h	Sat Aug  8 16:41:28 2020	(r364052)
@@ -159,9 +159,6 @@ void bc_parse_expr(BcParse *p, uint8_t flags);
 void bc_parse_parse(BcParse *p);
 void bc_parse_expr_status(BcParse *p, uint8_t flags, BcParseNext next);
 
-// This is necessary to clear up for if statements at the end of files.
-void bc_parse_noElse(BcParse *p);
-
 extern const char bc_sig_msg[];
 extern const uchar bc_sig_msg_len;
 

Modified: stable/12/contrib/bc/include/vm.h
==============================================================================
--- head/contrib/bc/include/vm.h	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/include/vm.h	Sat Aug  8 16:41:28 2020	(r364052)
@@ -102,20 +102,19 @@
 #define BC_FLAG_G (UINTMAX_C(1)<<4)
 #endif // BC_ENABLED
 
-#define BC_FLAG_Q (UINTMAX_C(1)<<5)
-#define BC_FLAG_I (UINTMAX_C(1)<<6)
-#define BC_FLAG_P (UINTMAX_C(1)<<7)
-#define BC_FLAG_TTYIN (UINTMAX_C(1)<<8)
-#define BC_FLAG_TTY (UINTMAX_C(1)<<9)
+#define BC_FLAG_I (UINTMAX_C(1)<<5)
+#define BC_FLAG_P (UINTMAX_C(1)<<6)
+#define BC_FLAG_TTYIN (UINTMAX_C(1)<<7)
+#define BC_FLAG_TTY (UINTMAX_C(1)<<8)
 #define BC_TTYIN (vm.flags & BC_FLAG_TTYIN)
 #define BC_TTY (vm.flags & BC_FLAG_TTY)
 
 #if BC_ENABLED
 
-#define BC_S (BC_ENABLED && (vm.flags & BC_FLAG_S))
-#define BC_W (BC_ENABLED && (vm.flags & BC_FLAG_W))
-#define BC_L (BC_ENABLED && (vm.flags & BC_FLAG_L))
-#define BC_G (BC_ENABLED && (vm.flags & BC_FLAG_G))
+#define BC_S (vm.flags & BC_FLAG_S)
+#define BC_W (vm.flags & BC_FLAG_W)
+#define BC_L (vm.flags & BC_FLAG_L)
+#define BC_G (vm.flags & BC_FLAG_G)
 
 #endif // BC_ENABLED
 
@@ -279,12 +278,6 @@
 
 #define BC_VM_INVALID_CATALOG ((nl_catd) -1)
 
-// dc does not use is_stdin.
-#if !BC_ENABLED
-#define bc_vm_process(text, is_stdin) bc_vm_process(text)
-#else // BC_ENABLED
-#endif // BC_ENABLED
-
 typedef struct BcVm {
 
 	volatile sig_atomic_t status;
@@ -310,6 +303,7 @@ typedef struct BcVm {
 	uint16_t nchars;
 	uint16_t line_len;
 
+	bool no_exit_exprs;
 	bool eof;
 
 	BcBigDig maxes[BC_PROG_GLOBALS_LEN + BC_ENABLE_EXTRA_MATH];
@@ -360,7 +354,7 @@ typedef struct BcVm {
 
 void bc_vm_info(const char* const help);
 void bc_vm_boot(int argc, char *argv[], const char *env_len,
-                const char* const env_args, const char* env_exp_quit);
+                const char* const env_args);
 void bc_vm_shutdown(void);
 
 void bc_vm_printf(const char *fmt, ...);

Modified: stable/12/contrib/bc/locale_install.sh
==============================================================================
--- head/contrib/bc/locale_install.sh	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/locale_install.sh	Sat Aug  8 16:41:28 2020	(r364052)
@@ -28,6 +28,9 @@
 #
 
 usage() {
+	if [ $# -eq 1 ]; then
+		printf '%s\n' "$1"
+	fi
 	printf "usage: %s NLSPATH main_exec [DESTDIR]\n" "$0" 1>&2
 	exit 1
 }
@@ -150,6 +153,17 @@ scriptdir=$(dirname "$script")
 
 . "$scriptdir/functions.sh"
 
+all_locales=0
+
+while getopts "l" opt; do
+
+	case "$opt" in
+		l) all_locales=1 ; shift ;;
+		?) usage "Invalid option $opt" ;;
+	esac
+
+done
+
 test "$#" -ge 2 || usage
 
 nlspath="$1"
@@ -180,19 +194,23 @@ fi
 for file in $locales_dir/*.msg; do
 
 	locale=$(basename "$file" ".msg")
-	loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec")
 
-	localeexists "$locales" "$locale" "$destdir"
-	err="$?"
+	if [ "$all_locales" -eq 0 ]; then
 
-	if [ "$err" -eq 0 ]; then
-		continue
+		localeexists "$locales" "$locale" "$destdir"
+		err="$?"
+
+		if [ "$err" -eq 0 ]; then
+			continue
+		fi
 	fi
 
 	if [ -L "$file" ]; then
 		continue
 	fi
 
+	loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec")
+
 	gencatfile "$loc" "$file"
 
 done
@@ -200,14 +218,18 @@ done
 for file in $locales_dir/*.msg; do
 
 	locale=$(basename "$file" ".msg")
-	loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec")
 
-	localeexists "$locales" "$locale" "$destdir"
-	err="$?"
+	if [ "$all_locales" -eq 0 ]; then
 
-	if [ "$err" -eq 0 ]; then
-		continue
+		localeexists "$locales" "$locale" "$destdir"
+		err="$?"
+
+		if [ "$err" -eq 0 ]; then
+			continue
+		fi
 	fi
+
+	loc=$(gen_nlspath "$destdir/$nlspath" "$locale" "$main_exec")
 
 	mkdir -p $(dirname "$loc")
 

Modified: stable/12/contrib/bc/locale_uninstall.sh
==============================================================================
--- head/contrib/bc/locale_uninstall.sh	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/locale_uninstall.sh	Sat Aug  8 16:41:28 2020	(r364052)
@@ -59,6 +59,7 @@ fi
 # This way, we can delete catalogs for locales that we had to install
 # because they are symlinks.
 locales=$(gen_nlspath "$destdir/$nlspath" "*" "$main_exec")
+locales=$(ls $locales 2> /dev/null)
 
 for l in $locales; do
 	rm -f "$l"

Modified: stable/12/contrib/bc/locales/zh_CN.GB18030.msg
==============================================================================
Binary file (source and/or target). No diff available.

Modified: stable/12/contrib/bc/locales/zh_CN.GB2312.msg
==============================================================================
Binary file (source and/or target). No diff available.

Modified: stable/12/contrib/bc/locales/zh_CN.GBK.msg
==============================================================================
Binary file (source and/or target). No diff available.

Modified: stable/12/contrib/bc/locales/zh_CN.UTF-8.msg
==============================================================================
Binary file (source and/or target). No diff available.

Modified: stable/12/contrib/bc/locales/zh_CN.eucCN.msg
==============================================================================
Binary file (source and/or target). No diff available.

Modified: stable/12/contrib/bc/manuals/bc.1.md.in
==============================================================================
--- head/contrib/bc/manuals/bc.1.md.in	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc.1.md.in	Sat Aug  8 16:41:28 2020	(r364052)
@@ -195,11 +195,11 @@ The following are the options that bc(1) accepts.
 
 **-q**, **--quiet**
 
-:   Do not print copyright header. bc(1) will also suppress the header in
-    non-interactive mode.
+:   This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+    Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+    prints the copyright header if one or more of the **-v**, **-V**, or
+    **--version** options are given.
 
-    This is mostly for compatibility with the [GNU bc(1)][2].
-
     This is a **non-portable extension**.
 
 **-s**, **--standard**
@@ -229,9 +229,10 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the expressions and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    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.
 
     This is a **non-portable extension**.
 
@@ -241,9 +242,8 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the files and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    After processing all expressions and files, bc(1) will exit, unless **-**
+    (**stdin**) was given as an argument at least once to **-f** or **--file**.
 
     This is a **non-portable extension**.
 
@@ -1614,12 +1614,6 @@ bc(1) recognizes the following environment variables:
     than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output
     lines to that length, including the backslash (**\\**). The default line
     length is **70**.
-
-**BC_EXPR_EXIT**
-
-:   If this variable exists (no matter the contents), bc(1) will exit
-    immediately after executing expressions and files given by the **-e** and/or
-    **-f** command-line options (and any equivalents).
 
 # EXIT STATUS
 

Modified: stable/12/contrib/bc/manuals/bc/A.1
==============================================================================
--- head/contrib/bc/manuals/bc/A.1	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/A.1	Sat Aug  8 16:41:28 2020	(r364052)
@@ -187,13 +187,13 @@ This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
 .B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
 .RS
 .PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
 This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
@@ -231,10 +231,12 @@ This means that if a file is given before an expressio
 read in and evaluated first.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -246,10 +248,9 @@ If expressions are also given (see above), the express
 in the order given.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -1913,14 +1914,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M
 (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including
 the backslash (\f[B]\\\f[]).
 The default line length is \f[B]70\f[].
-.RS
-.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
 .RS
 .RE
 .SH EXIT STATUS

Modified: stable/12/contrib/bc/manuals/bc/A.1.md
==============================================================================
--- head/contrib/bc/manuals/bc/A.1.md	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/A.1.md	Sat Aug  8 16:41:28 2020	(r364052)
@@ -153,11 +153,11 @@ The following are the options that bc(1) accepts.
 
 **-q**, **--quiet**
 
-:   Do not print copyright header. bc(1) will also suppress the header in
-    non-interactive mode.
+:   This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+    Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+    prints the copyright header if one or more of the **-v**, **-V**, or
+    **--version** options are given.
 
-    This is mostly for compatibility with the [GNU bc(1)][2].
-
     This is a **non-portable extension**.
 
 **-s**, **--standard**
@@ -187,9 +187,10 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the expressions and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    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.
 
     This is a **non-portable extension**.
 
@@ -199,9 +200,8 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the files and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    After processing all expressions and files, bc(1) will exit, unless **-**
+    (**stdin**) was given as an argument at least once to **-f** or **--file**.
 
     This is a **non-portable extension**.
 
@@ -1523,12 +1523,6 @@ bc(1) recognizes the following environment variables:
     than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output
     lines to that length, including the backslash (**\\**). The default line
     length is **70**.
-
-**BC_EXPR_EXIT**
-
-:   If this variable exists (no matter the contents), bc(1) will exit
-    immediately after executing expressions and files given by the **-e** and/or
-    **-f** command-line options (and any equivalents).
 
 # EXIT STATUS
 

Modified: stable/12/contrib/bc/manuals/bc/E.1
==============================================================================
--- head/contrib/bc/manuals/bc/E.1	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/E.1	Sat Aug  8 16:41:28 2020	(r364052)
@@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
 .B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
 .RS
 .PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
 This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
@@ -192,10 +192,12 @@ This means that if a file is given before an expressio
 read in and evaluated first.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -207,10 +209,9 @@ If expressions are also given (see above), the express
 in the order given.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -1159,14 +1160,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M
 (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including
 the backslash (\f[B]\\\f[]).
 The default line length is \f[B]70\f[].
-.RS
-.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
 .RS
 .RE
 .SH EXIT STATUS

Modified: stable/12/contrib/bc/manuals/bc/E.1.md
==============================================================================
--- head/contrib/bc/manuals/bc/E.1.md	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/E.1.md	Sat Aug  8 16:41:28 2020	(r364052)
@@ -137,11 +137,11 @@ The following are the options that bc(1) accepts.
 
 **-q**, **--quiet**
 
-:   Do not print copyright header. bc(1) will also suppress the header in
-    non-interactive mode.
+:   This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+    Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+    prints the copyright header if one or more of the **-v**, **-V**, or
+    **--version** options are given.
 
-    This is mostly for compatibility with the [GNU bc(1)][2].
-
     This is a **non-portable extension**.
 
 **-s**, **--standard**
@@ -171,9 +171,10 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the expressions and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    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.
 
     This is a **non-portable extension**.
 
@@ -183,9 +184,8 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the files and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    After processing all expressions and files, bc(1) will exit, unless **-**
+    (**stdin**) was given as an argument at least once to **-f** or **--file**.
 
     This is a **non-portable extension**.
 
@@ -919,12 +919,6 @@ bc(1) recognizes the following environment variables:
     than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output
     lines to that length, including the backslash (**\\**). The default line
     length is **70**.
-
-**BC_EXPR_EXIT**
-
-:   If this variable exists (no matter the contents), bc(1) will exit
-    immediately after executing expressions and files given by the **-e** and/or
-    **-f** command-line options (and any equivalents).
 
 # EXIT STATUS
 

Modified: stable/12/contrib/bc/manuals/bc/EH.1
==============================================================================
--- head/contrib/bc/manuals/bc/EH.1	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/EH.1	Sat Aug  8 16:41:28 2020	(r364052)
@@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
 .B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
 .RS
 .PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
 This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
@@ -189,10 +189,12 @@ This means that if a file is given before an expressio
 read in and evaluated first.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -204,10 +206,9 @@ If expressions are also given (see above), the express
 in the order given.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M
 (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including
 the backslash (\f[B]\\\f[]).
 The default line length is \f[B]70\f[].
-.RS
-.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
 .RS
 .RE
 .SH EXIT STATUS

Modified: stable/12/contrib/bc/manuals/bc/EH.1.md
==============================================================================
--- head/contrib/bc/manuals/bc/EH.1.md	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/EH.1.md	Sat Aug  8 16:41:28 2020	(r364052)
@@ -134,11 +134,11 @@ The following are the options that bc(1) accepts.
 
 **-q**, **--quiet**
 
-:   Do not print copyright header. bc(1) will also suppress the header in
-    non-interactive mode.
+:   This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+    Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+    prints the copyright header if one or more of the **-v**, **-V**, or
+    **--version** options are given.
 
-    This is mostly for compatibility with the [GNU bc(1)][2].
-
     This is a **non-portable extension**.
 
 **-s**, **--standard**
@@ -168,9 +168,10 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the expressions and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    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.
 
     This is a **non-portable extension**.
 
@@ -180,9 +181,8 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the files and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    After processing all expressions and files, bc(1) will exit, unless **-**
+    (**stdin**) was given as an argument at least once to **-f** or **--file**.
 
     This is a **non-portable extension**.
 
@@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables:
     than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output
     lines to that length, including the backslash (**\\**). The default line
     length is **70**.
-
-**BC_EXPR_EXIT**
-
-:   If this variable exists (no matter the contents), bc(1) will exit
-    immediately after executing expressions and files given by the **-e** and/or
-    **-f** command-line options (and any equivalents).
 
 # EXIT STATUS
 

Modified: stable/12/contrib/bc/manuals/bc/EHN.1
==============================================================================
--- head/contrib/bc/manuals/bc/EHN.1	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/EHN.1	Sat Aug  8 16:41:28 2020	(r364052)
@@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
 .B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
 .RS
 .PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
 This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
@@ -189,10 +189,12 @@ This means that if a file is given before an expressio
 read in and evaluated first.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -204,10 +206,9 @@ If expressions are also given (see above), the express
 in the order given.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M
 (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including
 the backslash (\f[B]\\\f[]).
 The default line length is \f[B]70\f[].
-.RS
-.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
 .RS
 .RE
 .SH EXIT STATUS

Modified: stable/12/contrib/bc/manuals/bc/EHN.1.md
==============================================================================
--- head/contrib/bc/manuals/bc/EHN.1.md	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/EHN.1.md	Sat Aug  8 16:41:28 2020	(r364052)
@@ -134,11 +134,11 @@ The following are the options that bc(1) accepts.
 
 **-q**, **--quiet**
 
-:   Do not print copyright header. bc(1) will also suppress the header in
-    non-interactive mode.
+:   This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+    Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+    prints the copyright header if one or more of the **-v**, **-V**, or
+    **--version** options are given.
 
-    This is mostly for compatibility with the [GNU bc(1)][2].
-
     This is a **non-portable extension**.
 
 **-s**, **--standard**
@@ -168,9 +168,10 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the expressions and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    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.
 
     This is a **non-portable extension**.
 
@@ -180,9 +181,8 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the files and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    After processing all expressions and files, bc(1) will exit, unless **-**
+    (**stdin**) was given as an argument at least once to **-f** or **--file**.
 
     This is a **non-portable extension**.
 
@@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables:
     than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output
     lines to that length, including the backslash (**\\**). The default line
     length is **70**.
-
-**BC_EXPR_EXIT**
-
-:   If this variable exists (no matter the contents), bc(1) will exit
-    immediately after executing expressions and files given by the **-e** and/or
-    **-f** command-line options (and any equivalents).
 
 # EXIT STATUS
 

Modified: stable/12/contrib/bc/manuals/bc/EHNP.1
==============================================================================
--- head/contrib/bc/manuals/bc/EHNP.1	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/EHNP.1	Sat Aug  8 16:41:28 2020	(r364052)
@@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
 .B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
 .RS
 .PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
 This is a \f[B]non\-portable extension\f[].
 .RE
 .TP
@@ -184,10 +184,12 @@ This means that if a file is given before an expressio
 read in and evaluated first.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -199,10 +201,9 @@ If expressions are also given (see above), the express
 in the order given.
 .RS
 .PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
 .PP
 This is a \f[B]non\-portable extension\f[].
 .RE
@@ -1151,14 +1152,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M
 (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including
 the backslash (\f[B]\\\f[]).
 The default line length is \f[B]70\f[].
-.RS
-.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
 .RS
 .RE
 .SH EXIT STATUS

Modified: stable/12/contrib/bc/manuals/bc/EHNP.1.md
==============================================================================
--- head/contrib/bc/manuals/bc/EHNP.1.md	Tue Jul  7 07:51:09 2020	(r362987)
+++ stable/12/contrib/bc/manuals/bc/EHNP.1.md	Sat Aug  8 16:41:28 2020	(r364052)
@@ -130,11 +130,11 @@ The following are the options that bc(1) accepts.
 
 **-q**, **--quiet**
 
-:   Do not print copyright header. bc(1) will also suppress the header in
-    non-interactive mode.
+:   This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+    Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+    prints the copyright header if one or more of the **-v**, **-V**, or
+    **--version** options are given.
 
-    This is mostly for compatibility with the [GNU bc(1)][2].
-
     This is a **non-portable extension**.
 
 **-s**, **--standard**
@@ -164,9 +164,10 @@ 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.
 
-    In other bc(1) implementations, this option causes the program to execute
-    the expressions and then exit. This bc(1) does not, unless the
-    **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+    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.
 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list