diff options
author | Stefan Eßer <se@FreeBSD.org> | 2021-05-12 05:35:58 +0000 |
---|---|---|
committer | Stefan Eßer <se@FreeBSD.org> | 2021-05-12 05:35:58 +0000 |
commit | 2858419a0ee2b8f5827de72c00618bcd69ebc5fc (patch) | |
tree | a5e3efc2128cbf0d2904663187367ce0c2fef260 | |
parent | bd136720030ebb0b31e6d5a2236b9d0ddac71b94 (diff) |
-rw-r--r-- | NEWS.md | 9 | ||||
-rw-r--r-- | include/history.h | 1 | ||||
-rw-r--r-- | include/version.h | 2 | ||||
-rw-r--r-- | src/history.c | 5 | ||||
-rw-r--r-- | src/vm.c | 2 | ||||
-rwxr-xr-x | tests/other.sh | 5 |
6 files changed, 19 insertions, 5 deletions
@@ -1,5 +1,14 @@ # News +## 4.0.2 + +This is a production release that fixes two bugs: + +1. If no files are used and the first statement on `stdin` is invalid, `scale` + would not be set to `20` even if `-l` was used. +2. When using history, `bc` failed to respond properly to `SIGSTOP` and + `SIGTSTP`. + ## 4.0.1 This is a production release that only adds one thing: flushing output when it diff --git a/include/history.h b/include/history.h index 469785a118a9..444a2a107ac5 100644 --- a/include/history.h +++ b/include/history.h @@ -165,6 +165,7 @@ typedef enum BcHistoryAction { BC_ACTION_ENTER = 13, BC_ACTION_CTRL_N = 14, BC_ACTION_CTRL_P = 16, + BC_ACTION_CTRL_S = 19, BC_ACTION_CTRL_T = 20, BC_ACTION_CTRL_U = 21, BC_ACTION_CTRL_W = 23, diff --git a/include/version.h b/include/version.h index ab4823bd7c2a..42eb3a11d2c0 100644 --- a/include/version.h +++ b/include/version.h @@ -36,6 +36,6 @@ #ifndef BC_VERSION_H #define BC_VERSION_H -#define VERSION 4.0.1 +#define VERSION 4.0.2 #endif // BC_VERSION_H diff --git a/src/history.c b/src/history.c index c0d54fe35234..317d9193036c 100644 --- a/src/history.c +++ b/src/history.c @@ -1281,8 +1281,11 @@ static BcStatus bc_history_edit(BcHistory *h, const char *prompt) { default: { - if (c >= BC_ACTION_CTRL_A && c <= BC_ACTION_CTRL_Z) + if (c >= BC_ACTION_CTRL_A && c <= BC_ACTION_CTRL_Z) { bc_history_printCtrl(h, c); + if (c == BC_ACTION_CTRL_Z) raise(SIGTSTP); + if (c == BC_ACTION_CTRL_S) raise(SIGSTOP); + } else bc_history_edit_insert(h, cbuf, nread); break; } @@ -835,6 +835,8 @@ static void bc_vm_exec(void) { #if BC_ENABLE_EXTRA_MATH if (!BC_IS_POSIX) bc_vm_load(bc_lib2_name, bc_lib2); #endif // BC_ENABLE_EXTRA_MATH + + bc_program_exec(&vm.prog); } #endif // BC_ENABLED diff --git a/tests/other.sh b/tests/other.sh index d2ef4f6d0694..e13891fcad89 100755 --- a/tests/other.sh +++ b/tests/other.sh @@ -138,7 +138,7 @@ else set +e - printf 'three\n' | head -c3 > /dev/null + printf 'three\n' | cut -c1-3 > /dev/null err=$? if [ "$err" -eq 0 ]; then @@ -156,8 +156,7 @@ else printf '4 April 2021\n' > "$easter_res" - "$testdir/dc/scripts/easter.sh" "$exe" 2021 | head -c12 > "$easter_out" - printf '\n' >> "$easter_out" + "$testdir/dc/scripts/easter.sh" "$exe" 2021 | cut -c1-12 > "$easter_out" err="$?" checktest "$d" "$err" "Easter script" "$easter_res" "$easter_out" |