summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2023-02-24 22:14:58 +0000
committerStefan Eßer <se@FreeBSD.org>2023-02-24 22:14:58 +0000
commit61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427 (patch)
tree86bf7579a17d0deeccf9d4a705c36eed3b1e3273
parentaaf1213c6f70af0b517f6aa13cd837d3468a7a0d (diff)
vendor/bc: import version 6.3.1vendor/bc/6.3.1
This version adds a command to dc to query whether extended registers are enabled or not.
-rw-r--r--MEMORY_BUGS.md5
-rw-r--r--Makefile.in10
-rw-r--r--NEWS.md25
-rw-r--r--gen/lib2.bc4
-rw-r--r--gen/strgen.c6
-rwxr-xr-xgen/strgen.sh4
-rw-r--r--include/bcl.h6
-rw-r--r--include/lang.h7
-rw-r--r--include/lex.h17
-rw-r--r--include/parse.h14
-rw-r--r--include/program.h12
-rw-r--r--include/rand.h6
-rw-r--r--include/status.h24
-rw-r--r--include/vector.h4
-rw-r--r--include/version.h2
-rw-r--r--include/vm.h6
-rw-r--r--manuals/bc/A.16
-rw-r--r--manuals/bc/A.1.md2
-rw-r--r--manuals/bc/E.16
-rw-r--r--manuals/bc/E.1.md2
-rw-r--r--manuals/bc/EH.16
-rw-r--r--manuals/bc/EH.1.md2
-rw-r--r--manuals/bc/EHN.16
-rw-r--r--manuals/bc/EHN.1.md2
-rw-r--r--manuals/bc/EN.16
-rw-r--r--manuals/bc/EN.1.md2
-rw-r--r--manuals/bc/H.16
-rw-r--r--manuals/bc/H.1.md2
-rw-r--r--manuals/bc/HN.16
-rw-r--r--manuals/bc/HN.1.md2
-rw-r--r--manuals/bc/N.16
-rw-r--r--manuals/bc/N.1.md2
-rw-r--r--manuals/bcl.32
-rw-r--r--manuals/dc/A.112
-rw-r--r--manuals/dc/A.1.md10
-rw-r--r--manuals/dc/E.112
-rw-r--r--manuals/dc/E.1.md10
-rw-r--r--manuals/dc/EH.112
-rw-r--r--manuals/dc/EH.1.md10
-rw-r--r--manuals/dc/EHN.112
-rw-r--r--manuals/dc/EHN.1.md10
-rw-r--r--manuals/dc/EN.112
-rw-r--r--manuals/dc/EN.1.md10
-rw-r--r--manuals/dc/H.112
-rw-r--r--manuals/dc/H.1.md10
-rw-r--r--manuals/dc/HN.112
-rw-r--r--manuals/dc/HN.1.md10
-rw-r--r--manuals/dc/N.112
-rw-r--r--manuals/dc/N.1.md10
-rwxr-xr-xscripts/exec-install.sh6
-rwxr-xr-xscripts/format.sh2
-rwxr-xr-xscripts/link.sh5
-rwxr-xr-xscripts/lint.sh5
-rwxr-xr-xscripts/locale_install.sh3
-rwxr-xr-xscripts/safe-install.sh12
-rw-r--r--src/args.c4
-rw-r--r--src/bc_parse.c6
-rw-r--r--src/data.c16
-rw-r--r--src/dc_lex.c1
-rw-r--r--src/dc_parse.c1
-rw-r--r--src/file.c4
-rw-r--r--src/history.c4
-rw-r--r--src/lang.c8
-rw-r--r--src/library.c4
-rw-r--r--src/num.c12
-rw-r--r--src/parse.c4
-rw-r--r--src/program.c49
-rw-r--r--src/read.c4
-rw-r--r--src/vm.c34
-rwxr-xr-xtests/all.sh3
-rwxr-xr-xtests/error.sh8
-rwxr-xr-xtests/errors.sh8
-rwxr-xr-xtests/other.sh120
-rwxr-xr-xtests/script.sh6
-rwxr-xr-xtests/scripts.sh5
-rwxr-xr-xtests/test.sh6
-rw-r--r--vs/bc.vcxproj2
77 files changed, 442 insertions, 294 deletions
diff --git a/MEMORY_BUGS.md b/MEMORY_BUGS.md
index d675b28b342a..12e0b854e9d8 100644
--- a/MEMORY_BUGS.md
+++ b/MEMORY_BUGS.md
@@ -51,3 +51,8 @@ existed in.
had properly hooked Valgrind into my `bcl` tests, but I had not.
The first version without this bug is `6.0.1`.
+
+* In version `6.0.0` until `6.2.4` (inclusive) of `bcl`, there is a possible
+ use-after-free if `bcl_init()` fails.
+
+ The first version without this bug is `6.2.5`.
diff --git a/Makefile.in b/Makefile.in
index 83417a333826..89ddb7589c47 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -239,25 +239,25 @@ $(GEN_EXEC): $(GEN_DIR)
%%GEN_EXEC_TARGET%%
$(BC_LIB_C): $(GEN_EXEC) $(BC_LIB)
- $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS)
+ $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) "" "" 1
$(BC_LIB_O): $(BC_LIB_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2)
- $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS)
+ $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) "" "" 1
$(BC_LIB2_O): $(BC_LIB2_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(BC_HELP_C): $(GEN_EXEC) $(BC_HELP)
- $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME)
+ $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) 0
$(BC_HELP_O): $(BC_HELP_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(DC_HELP_C): $(GEN_EXEC) $(DC_HELP)
- $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME)
+ $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) 0
$(DC_HELP_O): $(DC_HELP_C)
$(CC) $(CFLAGS) -o $@ -c $<
@@ -536,6 +536,7 @@ clean:%%CLEAN_PREREQS%%
@$(RM) -f $(BC_HELP_C) $(BC_HELP_O)
@$(RM) -f $(DC_HELP_C) $(DC_HELP_O)
@$(RM) -fr vs/bin/ vs/lib/
+ @$(RM) -f $(BCL_PC)
clean_benchmarks:
@printf 'Cleaning benchmarks...\n'
@@ -548,6 +549,7 @@ clean_config: clean clean_benchmarks
@$(RM) -f Makefile
@$(RM) -f $(BC_MD) $(BC_MANPAGE)
@$(RM) -f $(DC_MD) $(DC_MANPAGE)
+ @$(RM) -f compile_commands.json
clean_coverage:
@printf 'Cleaning coverage files...\n'
diff --git a/NEWS.md b/NEWS.md
index 4601db456f86..ad118e401c32 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,30 @@
# News
+## 6.3.1
+
+This is a production release that fixes a `bc` dependency loop for minimal
+environments and Linux from Scratch.
+
+## 6.3.0
+
+This is a production release with a couple of fixes for manuals and a new
+feature for `dc`: there is now a command to query whether extended registers are
+enabled or not.
+
+Users who don't care do not need to upgrade.
+
+## 6.2.6
+
+This is a production release that fixes an install bug that affected locale
+installation of all locales when using `mksh`. Users do ***NOT*** need to
+upgrade if they don't use `mksh` and/or don't need to install all locales.
+
+## 6.2.5
+
+This is a production release that fixes a test bug that affected Android and
+`mksh`. Users do ***NOT*** need to upgrade unless they use `mksh` or another
+affected shell and need to run the test suite.
+
## 6.2.4
This is a production release that fixes a test failure that happens when
diff --git a/gen/lib2.bc b/gen/lib2.bc
index 826f8a430cea..2811430d534e 100644
--- a/gen/lib2.bc
+++ b/gen/lib2.bc
@@ -36,7 +36,7 @@
define p(x,y){
auto a
a=y$
- if(y==a)return (x^a)@scale
+ if(y==a)return(x^a)@scale
return e(y*l(x))
}
define r(x,p){
@@ -474,7 +474,7 @@ define bxor(a,b){
return bunrev(t)
}
define bshl(a,b){return abs(a)$*2^abs(b)$}
-define bshr(a,b){return (abs(a)$/2^abs(b)$)$}
+define bshr(a,b){return(abs(a)$/2^abs(b)$)$}
define bnotn(x,n){
auto s,t,m[]
s=scale
diff --git a/gen/strgen.c b/gen/strgen.c
index dbea0212f617..2cb3ed9e8475 100644
--- a/gen/strgen.c
+++ b/gen/strgen.c
@@ -157,11 +157,11 @@ bc_read_file(const char* path)
assert(path != NULL);
-#ifndef NDEBUG
+#if BC_DEBUG
// Need this to quiet MSan.
// NOLINTNEXTLINE
memset(&pstat, 0, sizeof(struct stat));
-#endif // NDEBUG
+#endif // BC_DEBUG
fd = bc_read_open(path, O_RDONLY);
@@ -360,7 +360,7 @@ main(int argc, char* argv[])
has_define = (argc > 6 && strcmp("", argv[6]) != 0);
define = has_define ? argv[6] : "";
- remove_tabs = (argc > 7);
+ remove_tabs = (argc > 7 && atoi(argv[7]) != 0);
in = bc_read_file(argv[1]);
if (in == NULL) return INVALID_INPUT_FILE;
diff --git a/gen/strgen.sh b/gen/strgen.sh
index a65e221ad0b4..2b8927b5528e 100755
--- a/gen/strgen.sh
+++ b/gen/strgen.sh
@@ -62,7 +62,9 @@ name="$4"
label="$5"
define="$6"
remove_tabs="$7"
-check_bool_arg "$remove_tabs"
+if [ "$remove_tabs" != "" ]; then
+ check_bool_arg "$remove_tabs"
+fi
tmpinput=$(mktemp -t "${input##*/}_XXXXXX")
diff --git a/include/bcl.h b/include/bcl.h
index 234fe475f00e..253138231c66 100644
--- a/include/bcl.h
+++ b/include/bcl.h
@@ -41,6 +41,12 @@
#include <limits.h>
#include <stdint.h>
+#ifndef NDEBUG
+#define BC_DEBUG (1)
+#else // NDEBUG
+#define BC_DEBUG (0)
+#endif // NDEBUG
+
#ifdef _WIN32
#include <Windows.h>
#include <BaseTsd.h>
diff --git a/include/lang.h b/include/lang.h
index 2d9776532249..97aeeaa98da8 100644
--- a/include/lang.h
+++ b/include/lang.h
@@ -277,6 +277,9 @@ typedef enum BcInst
#if DC_ENABLED
+ /// dc extended registers command.
+ BC_INST_EXTENDED_REGISTERS,
+
/// dc's return; it pops an executing string off of the stack.
BC_INST_POP_EXEC,
@@ -575,7 +578,7 @@ bc_func_insert(BcFunc* f, struct BcProgram* p, char* name, BcType type,
void
bc_func_reset(BcFunc* f);
-#ifndef NDEBUG
+#if BC_DEBUG
/**
* Frees a function. This is a destructor. This is only used in debug builds
* because all functions are freed at exit. We free them in debug builds to
@@ -584,7 +587,7 @@ bc_func_reset(BcFunc* f);
*/
void
bc_func_free(void* func);
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* Initializes an array, which is the array type in bc and dc source code. Since
diff --git a/include/lex.h b/include/lex.h
index 54d704f8b447..ac9b7b6ea69c 100644
--- a/include/lex.h
+++ b/include/lex.h
@@ -49,11 +49,11 @@
* @param l The lexer.
* @param e The error.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line))
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* A convenience macro for throwing errors in lex code. This takes care of
@@ -61,12 +61,12 @@
* @param l The lexer.
* @param e The error.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_lex_verr(l, e, ...) \
(bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__))
-#endif // NDEBUG
+#endif // BC_DEBUG
// BC_LEX_NEG_CHAR returns the char that corresponds to negative for the
// current calculator.
@@ -409,6 +409,9 @@ typedef enum BcLexType
#if DC_ENABLED
+ /// dc extended registers keyword.
+ BC_LEX_EXTENDED_REGISTERS,
+
/// A special token for dc to calculate equal without a register.
BC_LEX_EQ_NO_REG,
@@ -533,7 +536,7 @@ void
bc_lex_init(BcLex* l);
/**
- * Frees a lexer. This is not guarded by #ifndef NDEBUG because a separate
+ * Frees a lexer. This is not guarded by #if BC_DEBUG because a separate
* parser is created at runtime to parse read() expressions and dc strings, and
* that parser needs a lexer.
* @param l The lexer to free.
diff --git a/include/parse.h b/include/parse.h
index 2527aeb824f8..ece413e7bd74 100644
--- a/include/parse.h
+++ b/include/parse.h
@@ -110,12 +110,12 @@
* @param p The parser.
* @param e The error.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_parse_err(p, e) \
(bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_parse_err(p, e) (bc_vm_handleError((e), (p)->l.line))
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* A convenience macro for throwing errors in parse code. This takes care of
@@ -124,13 +124,13 @@
* @param e The error.
* @param ... The varags that are needed.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_parse_verr(p, e, ...) \
(bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line, __VA_ARGS__))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_parse_verr(p, e, ...) \
(bc_vm_handleError((e), (p)->l.line, __VA_ARGS__))
-#endif // NDEBUG
+#endif // BC_DEBUG
// Forward declarations.
struct BcParse;
@@ -215,7 +215,7 @@ void
bc_parse_init(BcParse* p, struct BcProgram* prog, size_t func);
/**
- * Frees a parser. This is not guarded by #ifndef NDEBUG because a separate
+ * Frees a parser. This is not guarded by #if BC_DEBUG because a separate
* parser is created at runtime to parse read() expressions and dc strings.
* @param p The parser to free.
*/
diff --git a/include/program.h b/include/program.h
index 3a3ea6c9dab7..ff32d5db7760 100644
--- a/include/program.h
+++ b/include/program.h
@@ -247,9 +247,9 @@ typedef struct BcProgram
// In debug mode, we want bc to check the stack, but otherwise, we don't because
// the bc language implicitly mandates that the stack should always have enough
// items.
-#ifdef NDEBUG
+#ifdef BC_DEBUG
#define BC_PROG_NO_STACK_CHECK
-#endif // NDEBUG
+#endif // BC_DEBUG
#endif // DC_ENABLED
@@ -298,7 +298,7 @@ typedef void (*BcProgramUnary)(BcResult* r, BcNum* n);
void
bc_program_init(BcProgram* p);
-#ifndef NDEBUG
+#if BC_DEBUG
/**
* Frees a BcProgram. This is only used in debug builds because a BcProgram is
@@ -309,7 +309,7 @@ bc_program_init(BcProgram* p);
void
bc_program_free(BcProgram* p);
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* Prints a stack trace of the bc functions or dc strings currently executing.
@@ -608,6 +608,7 @@ extern const char bc_program_esc_seqs[];
&&lbl_BC_INST_MODEXP, \
&&lbl_BC_INST_DIVMOD, \
&&lbl_BC_INST_PRINT_STREAM, \
+ &&lbl_BC_INST_EXTENDED_REGISTERS, \
&&lbl_BC_INST_POP_EXEC, \
&&lbl_BC_INST_EXECUTE, \
&&lbl_BC_INST_EXEC_COND, \
@@ -701,6 +702,7 @@ extern const char bc_program_esc_seqs[];
&&lbl_BC_INST_MODEXP, \
&&lbl_BC_INST_DIVMOD, \
&&lbl_BC_INST_PRINT_STREAM, \
+ &&lbl_BC_INST_EXTENDED_REGISTERS, \
&&lbl_BC_INST_POP_EXEC, \
&&lbl_BC_INST_EXECUTE, \
&&lbl_BC_INST_EXEC_COND, \
@@ -959,6 +961,7 @@ extern const char bc_program_esc_seqs[];
&&lbl_BC_INST_MODEXP, \
&&lbl_BC_INST_DIVMOD, \
&&lbl_BC_INST_PRINT_STREAM, \
+ &&lbl_BC_INST_EXTENDED_REGISTERS, \
&&lbl_BC_INST_POP_EXEC, \
&&lbl_BC_INST_EXECUTE, \
&&lbl_BC_INST_EXEC_COND, \
@@ -1027,6 +1030,7 @@ extern const char bc_program_esc_seqs[];
&&lbl_BC_INST_MODEXP, \
&&lbl_BC_INST_DIVMOD, \
&&lbl_BC_INST_PRINT_STREAM, \
+ &&lbl_BC_INST_EXTENDED_REGISTERS, \
&&lbl_BC_INST_POP_EXEC, \
&&lbl_BC_INST_EXECUTE, \
&&lbl_BC_INST_EXEC_COND, \
diff --git a/include/rand.h b/include/rand.h
index 7db0ee90af1f..e516295d7c5c 100644
--- a/include/rand.h
+++ b/include/rand.h
@@ -53,11 +53,11 @@
#if BC_ENABLE_LIBRARY
#define BC_RAND_USE_FREE (1)
#else // BC_ENABLE_LIBRARY
-#ifndef NDEBUG
+#if BC_DEBUG
#define BC_RAND_USE_FREE (1)
-#else // NDEBUG
+#else // BC_DEBUG
#define BC_RAND_USE_FREE (0)
-#endif // NDEBUG
+#endif // BC_DEBUG
#endif // BC_ENABLE_LIBRARY
/**
diff --git a/include/status.h b/include/status.h
index 9962d58d0be0..198cf5704a57 100644
--- a/include/status.h
+++ b/include/status.h
@@ -700,7 +700,7 @@ typedef enum BcMode
#define BC_SIG_INTERRUPT(vm) BC_UNLIKELY((vm)->sig != 0)
#endif // _WIN32
-#ifndef NDEBUG
+#if BC_DEBUG
/// Assert that signals are locked. There are non-async-signal-safe functions in
/// bc, and they *must* have signals locked. Other functions are expected to
@@ -724,7 +724,7 @@ typedef enum BcMode
} \
while (0)
-#else // NDEBUG
+#else // BC_DEBUG
/// Assert that signals are locked. There are non-async-signal-safe functions in
/// bc, and they *must* have signals locked. Other functions are expected to
@@ -738,7 +738,7 @@ typedef enum BcMode
/// (no-op in non-debug mode) that check that signals are unlocked.
#define BC_SIG_ASSERT_NOT_LOCKED
-#endif // NDEBUG
+#endif // BC_DEBUG
/// Locks signals.
#define BC_SIG_LOCK \
@@ -957,33 +957,33 @@ typedef enum BcMode
* @param l The line of the script that the error happened.
* @param ... Extra arguments for error messages as necessary.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_error(e, l, ...) \
(bc_vm_handleError((e), __FILE__, __LINE__, (l), __VA_ARGS__))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_error(e, l, ...) (bc_vm_handleError((e), (l), __VA_ARGS__))
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* Call bc's error handling routine.
* @param e The error.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_err(e) (bc_vm_handleError((e), __FILE__, __LINE__, 0))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_err(e) (bc_vm_handleError((e), 0))
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* Call bc's error handling routine.
* @param e The error.
*/
-#ifndef NDEBUG
+#if BC_DEBUG
#define bc_verr(e, ...) \
(bc_vm_handleError((e), __FILE__, __LINE__, 0, __VA_ARGS__))
-#else // NDEBUG
+#else // BC_DEBUG
#define bc_verr(e, ...) (bc_vm_handleError((e), 0, __VA_ARGS__))
-#endif // NDEBUG
+#endif // BC_DEBUG
#endif // BC_ENABLE_LIBRARY
diff --git a/include/vector.h b/include/vector.h
index 51c5e8b95293..b86be1424537 100644
--- a/include/vector.h
+++ b/include/vector.h
@@ -85,12 +85,12 @@ typedef enum BcDtorType
#if !BC_ENABLE_LIBRARY
-#ifndef NDEBUG
+#if BC_DEBUG
/// BcFunc destructor.
BC_DTOR_FUNC,
-#endif // NDEBUG
+#endif // BC_DEBUG
/// BcSlab destructor.
BC_DTOR_SLAB,
diff --git a/include/version.h b/include/version.h
index 6d8ddfea0940..f5e345b3b189 100644
--- a/include/version.h
+++ b/include/version.h
@@ -37,6 +37,6 @@
#define BC_VERSION_H
/// The current version.
-#define VERSION 6.2.4
+#define VERSION 6.3.1
#endif // BC_VERSION_H
diff --git a/include/vm.h b/include/vm.h
index 1c303add2de0..dd21d43f5260 100644
--- a/include/vm.h
+++ b/include/vm.h
@@ -999,7 +999,7 @@ bc_vm_atexit(void);
size_t
bc_vm_numDigits(size_t val);
-#ifndef NDEBUG
+#if BC_DEBUG
/**
* Handle an error. This is the true error handler. It will start a jump series
@@ -1013,7 +1013,7 @@ bc_vm_numDigits(size_t val);
void
bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...);
-#else // NDEBUG
+#else // BC_DEBUG
/**
* Handle an error. This is the true error handler. It will start a jump series
@@ -1025,7 +1025,7 @@ bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...);
void
bc_vm_handleError(BcErr e, size_t line, ...);
-#endif // NDEBUG
+#endif // BC_DEBUG
/**
* Handle a fatal error.
diff --git a/manuals/bc/A.1 b/manuals/bc/A.1
index b1996a1f282e..5de2d3529bcf 100644
--- a/manuals/bc/A.1
+++ b/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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/A.1.md b/manuals/bc/A.1.md
index e7b4c8212190..3f34f451c9ed 100644
--- a/manuals/bc/A.1.md
+++ b/manuals/bc/A.1.md
@@ -372,7 +372,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bc/E.1 b/manuals/bc/E.1
index fea1cecdc4c5..ecb8b128712a 100644
--- a/manuals/bc/E.1
+++ b/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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/E.1.md b/manuals/bc/E.1.md
index 3631267f2dc9..5411dcf6cc70 100644
--- a/manuals/bc/E.1.md
+++ b/manuals/bc/E.1.md
@@ -344,7 +344,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bc/EH.1 b/manuals/bc/EH.1
index 2a36cab7f778..507e7f4a9a7a 100644
--- a/manuals/bc/EH.1
+++ b/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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/EH.1.md b/manuals/bc/EH.1.md
index f2f49ea76944..6f4c43263003 100644
--- a/manuals/bc/EH.1.md
+++ b/manuals/bc/EH.1.md
@@ -344,7 +344,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bc/EHN.1 b/manuals/bc/EHN.1
index 75768a03c141..e00fcd578b1c 100644
--- a/manuals/bc/EHN.1
+++ b/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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/EHN.1.md b/manuals/bc/EHN.1.md
index a38503cc8a24..6f7a33210205 100644
--- a/manuals/bc/EHN.1.md
+++ b/manuals/bc/EHN.1.md
@@ -344,7 +344,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bc/EN.1 b/manuals/bc/EN.1
index 9c0158583199..ea842eac7e97 100644
--- a/manuals/bc/EN.1
+++ b/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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/EN.1.md b/manuals/bc/EN.1.md
index 28b558d8b21d..189193bf2a03 100644
--- a/manuals/bc/EN.1.md
+++ b/manuals/bc/EN.1.md
@@ -344,7 +344,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bc/H.1 b/manuals/bc/H.1
index cbd93da0df81..d477dc8ab24b 100644
--- a/manuals/bc/H.1
+++ b/manuals/bc/H.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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/H.1.md b/manuals/bc/H.1.md
index ac35def9019f..2cb0b4eb27cc 100644
--- a/manuals/bc/H.1.md
+++ b/manuals/bc/H.1.md
@@ -372,7 +372,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bc/HN.1 b/manuals/bc/HN.1
index 5893d2a7f9a9..10d9621c42ee 100644
--- a/manuals/bc/HN.1
+++ b/manuals/bc/HN.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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/HN.1.md b/manuals/bc/HN.1.md
index 82a99addd344..25f136a21e0a 100644
--- a/manuals/bc/HN.1.md
+++ b/manuals/bc/HN.1.md
@@ -372,7 +372,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bc/N.1 b/manuals/bc/N.1
index 791f47407001..f39e51277b65 100644
--- a/manuals/bc/N.1
+++ b/manuals/bc/N.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" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
+\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions
+in the extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
diff --git a/manuals/bc/N.1.md b/manuals/bc/N.1.md
index b8339ea31a5e..56a4b2274d29 100644
--- a/manuals/bc/N.1.md
+++ b/manuals/bc/N.1.md
@@ -372,7 +372,7 @@ The following are the options that bc(1) accepts.
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
+ This can be set for individual numbers with the **plz(x)**, **plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
diff --git a/manuals/bcl.3 b/manuals/bcl.3
index 6bebaa8f02cd..5c3731a141eb 100644
--- a/manuals/bcl.3
+++ b/manuals/bcl.3
@@ -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 "BCL" "3" "October 2022" "Gavin D. Howard" "Libraries Manual"
+.TH "BCL" "3" "February 2023" "Gavin D. Howard" "Libraries Manual"
.nh
.ad l
.SH NAME
diff --git a/manuals/dc/A.1 b/manuals/dc/A.1
index 13ed8c4cf808..bef54876d7f2 100644
--- a/manuals/dc/A.1
+++ b/manuals/dc/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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -271,10 +271,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1255,6 +1251,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/A.1.md b/manuals/dc/A.1.md
index b656650cb820..44b1578b670c 100644
--- a/manuals/dc/A.1.md
+++ b/manuals/dc/A.1.md
@@ -224,10 +224,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -1087,6 +1083,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/manuals/dc/E.1 b/manuals/dc/E.1
index 3fb69dfe70da..41de5e08f743 100644
--- a/manuals/dc/E.1
+++ b/manuals/dc/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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -256,10 +256,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1040,6 +1036,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/E.1.md b/manuals/dc/E.1.md
index 0bbe97612889..8a172d8a124b 100644
--- a/manuals/dc/E.1.md
+++ b/manuals/dc/E.1.md
@@ -215,10 +215,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -918,6 +914,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/manuals/dc/EH.1 b/manuals/dc/EH.1
index da7776edd538..08cb483dc926 100644
--- a/manuals/dc/EH.1
+++ b/manuals/dc/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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -256,10 +256,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1040,6 +1036,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/EH.1.md b/manuals/dc/EH.1.md
index 0751d3f78d21..1c5b6f566b19 100644
--- a/manuals/dc/EH.1.md
+++ b/manuals/dc/EH.1.md
@@ -215,10 +215,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -918,6 +914,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/manuals/dc/EHN.1 b/manuals/dc/EHN.1
index 10ef283ea056..efeb0bbaecf9 100644
--- a/manuals/dc/EHN.1
+++ b/manuals/dc/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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -256,10 +256,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1040,6 +1036,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/EHN.1.md b/manuals/dc/EHN.1.md
index 9ba7fe13e0ad..8a3c6d2b7807 100644
--- a/manuals/dc/EHN.1.md
+++ b/manuals/dc/EHN.1.md
@@ -215,10 +215,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -918,6 +914,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/manuals/dc/EN.1 b/manuals/dc/EN.1
index abdcbe8c63f8..ce1e6b9be79c 100644
--- a/manuals/dc/EN.1
+++ b/manuals/dc/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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -256,10 +256,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1040,6 +1036,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/EN.1.md b/manuals/dc/EN.1.md
index 5c0590c53aee..f8deee533c4e 100644
--- a/manuals/dc/EN.1.md
+++ b/manuals/dc/EN.1.md
@@ -215,10 +215,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -918,6 +914,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/manuals/dc/H.1 b/manuals/dc/H.1
index c96100e51bc5..8baa0b74316e 100644
--- a/manuals/dc/H.1
+++ b/manuals/dc/H.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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -271,10 +271,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1255,6 +1251,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/H.1.md b/manuals/dc/H.1.md
index 0dddf66d700a..7166c155efa3 100644
--- a/manuals/dc/H.1.md
+++ b/manuals/dc/H.1.md
@@ -224,10 +224,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -1087,6 +1083,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/manuals/dc/HN.1 b/manuals/dc/HN.1
index a6644ecd575b..2a3926309868 100644
--- a/manuals/dc/HN.1
+++ b/manuals/dc/HN.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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -271,10 +271,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1255,6 +1251,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/HN.1.md b/manuals/dc/HN.1.md
index d39a7497d3ac..6239a12b2861 100644
--- a/manuals/dc/HN.1.md
+++ b/manuals/dc/HN.1.md
@@ -224,10 +224,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -1087,6 +1083,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/manuals/dc/N.1 b/manuals/dc/N.1
index f9aeb1acfb6c..b7b501fbed13 100644
--- a/manuals/dc/N.1
+++ b/manuals/dc/N.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 "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -271,10 +271,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
-This can be set for individual numbers with the \f[B]plz(x)\f[R],
-plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
-extended math library (see the \f[B]LIBRARY\f[R] section).
-.PP
This is a \f[B]non-portable extension\f[R].
.RE
.PP
@@ -1255,6 +1251,12 @@ section).
Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the
\f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack.
.TP
+\f[B]gx\f[R]
+Pushes \f[B]1\f[R] onto the stack if extended register mode is on,
+\f[B]0\f[R] otherwise.
+See the \f[I]Extended Register Mode\f[R] subsection of the
+\f[B]REGISTERS\f[R] section for more information.
+.TP
\f[B]gz\f[R]
Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not
been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options
diff --git a/manuals/dc/N.1.md b/manuals/dc/N.1.md
index 3c36661d3902..8795d947eec7 100644
--- a/manuals/dc/N.1.md
+++ b/manuals/dc/N.1.md
@@ -224,10 +224,6 @@ The following are the options that dc(1) accepts.
: Makes dc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
- This can be set for individual numbers with the **plz(x)**, plznl(x)**,
- **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
- the **LIBRARY** section).
-
This is a **non-portable extension**.
All long options are **non-portable extensions**.
@@ -1087,6 +1083,12 @@ other character produces a parse error (see the **ERRORS** section).
: Pushes the line length set by **DC_LINE_LENGTH** (see the **ENVIRONMENT
VARIABLES** section) onto the stack.
+**gx**
+
+: Pushes **1** onto the stack if extended register mode is on, **0**
+ otherwise. See the *Extended Register Mode* subsection of the **REGISTERS**
+ section for more information.
+
**gz**
: Pushes **0** onto the stack if the leading zero setting has not been enabled
diff --git a/scripts/exec-install.sh b/scripts/exec-install.sh
index 3b9375af3834..8180b29c9997 100755
--- a/scripts/exec-install.sh
+++ b/scripts/exec-install.sh
@@ -60,6 +60,12 @@ fi
# If it's a symlink, create an equivalent in the install directory.
for exe in $bindir/*; do
+ # Skip any directories in case the bin/ directory is also used as the
+ # prefix.
+ if [ -d "$exe" ]; then
+ continue
+ fi
+
base=$(basename "$exe")
if [ -L "$exe" ]; then
diff --git a/scripts/format.sh b/scripts/format.sh
index efb90ef1f328..dd227555b0fe 100755
--- a/scripts/format.sh
+++ b/scripts/format.sh
@@ -29,6 +29,8 @@
scriptdir=$(dirname "$0")
+. "$scriptdir/functions.sh"
+
cd "$scriptdir/.."
if [ "$#" -gt 0 ]; then
diff --git a/scripts/link.sh b/scripts/link.sh
index 4a472828f3e9..7d95f866e17b 100755
--- a/scripts/link.sh
+++ b/scripts/link.sh
@@ -32,6 +32,11 @@ usage() {
exit 1
}
+script="$0"
+scriptdir=$(dirname "$script")
+
+. "$scriptdir/functions.sh"
+
# Command-line processing.
test "$#" -gt 1 || usage
diff --git a/scripts/lint.sh b/scripts/lint.sh
index 78260dff2daa..5a217204f8f5 100755
--- a/scripts/lint.sh
+++ b/scripts/lint.sh
@@ -27,7 +27,10 @@
# POSSIBILITY OF SUCH DAMAGE.
#
-scriptdir=$(dirname "$0")
+script="$0"
+scriptdir=$(dirname "$script")
+
+. "$scriptdir/functions.sh"
cd "$scriptdir/.."
diff --git a/scripts/locale_install.sh b/scripts/locale_install.sh
index 75534a735cdb..3816f54ef495 100755
--- a/scripts/locale_install.sh
+++ b/scripts/locale_install.sh
@@ -184,11 +184,12 @@ all_locales=0
while getopts "l" opt; do
case "$opt" in
- l) all_locales=1 ; shift ;;
+ l) all_locales=1 ;;