From owner-dev-commits-src-all@freebsd.org Tue Jun 1 10:39:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98FE86506FC; Tue, 1 Jun 2021 10:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvTDT3JRzz4grm; Tue, 1 Jun 2021 10:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55A0D22384; Tue, 1 Jun 2021 10:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 151AdLBN059100; Tue, 1 Jun 2021 10:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 151AdLim059099; Tue, 1 Jun 2021 10:39:21 GMT (envelope-from git) Date: Tue, 1 Jun 2021 10:39:21 GMT Message-Id: <202106011039.151AdLim059099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: 3d5f931a771c - stable/13 - contrib/bc: update to version 4.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d5f931a771ce8937c0572a4fc11bf7a09323125 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 10:39:21 -0000 The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=3d5f931a771ce8937c0572a4fc11bf7a09323125 commit 3d5f931a771ce8937c0572a4fc11bf7a09323125 Author: Stefan Eßer AuthorDate: 2021-05-12 05:49:19 +0000 Commit: Stefan Eßer CommitDate: 2021-06-01 10:38:43 +0000 contrib/bc: update to version 4.0.2 Merge commit '2858419a0ee2b8f5827de72c00618bcd69ebc5fc' This update fixes the initialization of "scale" to 20 if started with -l and the initial statement leads to an error (e.g. contains a syntax error). Scale was initialized to 0 in that case. Another change is the support of job control in interactive mode with line editing enabled. The control characters have been interpreted as editing commands only, prior to this version. (cherry picked from commit 8c39e25220bb88cd027d0c3b0fe86e52f6abd150) --- contrib/bc/NEWS.md | 9 +++++++++ contrib/bc/include/history.h | 1 + contrib/bc/include/version.h | 2 +- contrib/bc/src/history.c | 5 ++++- contrib/bc/src/vm.c | 2 ++ contrib/bc/tests/other.sh | 5 ++--- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index c66e7b164c8a..c78bddd27e76 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -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/contrib/bc/include/history.h b/contrib/bc/include/history.h index 469785a118a9..444a2a107ac5 100644 --- a/contrib/bc/include/history.h +++ b/contrib/bc/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/contrib/bc/include/version.h b/contrib/bc/include/version.h index ab4823bd7c2a..42eb3a11d2c0 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/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/contrib/bc/src/history.c b/contrib/bc/src/history.c index c0d54fe35234..317d9193036c 100644 --- a/contrib/bc/src/history.c +++ b/contrib/bc/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; } diff --git a/contrib/bc/src/vm.c b/contrib/bc/src/vm.c index e7ee8d35ba54..d01c8fd6860f 100644 --- a/contrib/bc/src/vm.c +++ b/contrib/bc/src/vm.c @@ -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/contrib/bc/tests/other.sh b/contrib/bc/tests/other.sh index d2ef4f6d0694..e13891fcad89 100755 --- a/contrib/bc/tests/other.sh +++ b/contrib/bc/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"