From nobody Tue Sep 24 16:34:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XClnM73XWz5Y2wL; Tue, 24 Sep 2024 16:34:31 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XClnM61GSz4NsY; Tue, 24 Sep 2024 16:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727195671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fjE9g6N3HprdFCYjOJjuol610BUEBzRrslz/QWAwa8=; b=ut0CnBKiAruN+vp6pZBaLGopSDHdAGdgaMOiJeCDr9rWi15WU6765jTEXw8akx431r7Bqq fs6KUwRcZF+qZaSb40O3gQCRBAW0nnhDQRt7KDjHHbXxNKfDpIDoURvNDAnarRCjmx3BF5 Wgt+urwek3LPD1DVbRGiUSHZuoZLOeK7H5Q4AeKkb/XcPKMlKpDybh1Sz7RyVT/FPOzNTc LEilnLNOtPQJBuPLIPA25uj0m/gdZwNelT8kQikcL2Fm9Q9k2nLOX3ESahMLvypvvMjTSB UVlSFjWy4Oo7FDDng7RVod7sdzQpxtCJoe9eq31jM8r9U8+l762x8g3pbZLOSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727195671; a=rsa-sha256; cv=none; b=c3YC+y+3s2jjpZPxS0GRaW7VEmMJitQBz30e6X+TzUbblmZtUZXAh1T6htVqSy1L0Le3So hOcQb4VBlNMIvbLbyMWwf5uim3m+XaLpHdXGCl9M60PTswtTmn1OmNyI2ev5vHZwsWrGkR EeePZelPVYR6Fm19tR7Nojs91EJBWoXLfsM4vnhji2F77/TpbTz832pD4Tya64N4S596Pc SCnn0xXqBL7uqgFrZTQgpRKJJjeyCN/Qy88qM6KQblnW1bjnc6HeyjWVQ+b2AK6qdziPHx wtu9sVSBtM76Wr+zYQkeIbqFtDVIlMNn6sqogOeoo5yOqS3V+pIQMEbhXe7FJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727195671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fjE9g6N3HprdFCYjOJjuol610BUEBzRrslz/QWAwa8=; b=PQhecmrtbTDSdNmGjR1LHH4pFl2yxo9yxl7HixeOsFZmH7MXBZ7MSuQnohVobK5AUnF5Qa /E0uiGi8kLX5iMNaY/bjU8pQPpEANUSY6VzrkXII06bJrX503a+wYm3V/r2tZnxFJZe+ph lYLYBtEOI6kKQs2VDiTRuaaEBMY9KniLv3s9wQR0DK5pPMX5YDTMquMVCuN3aVVuXNnB/8 K2uAKyDxVCT84peKaZQn/ol+joTjL1yRswlsab/cB1jra7nYVc6LnWLvTuZnpyV4UPJlbX HlIkJEUU8OpF5BSNGRXw+pHDWQqfqi0xB7ltJ2rbHNYCpYVADpyLf4FPPRWuxA== 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 4XClnM4Bw8zcG4; Tue, 24 Sep 2024 16:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48OGYVfA024571; Tue, 24 Sep 2024 16:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OGYVYa024568; Tue, 24 Sep 2024 16:34:31 GMT (envelope-from git) Date: Tue, 24 Sep 2024 16:34:31 GMT Message-Id: <202409241634.48OGYVYa024568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 90ea553a0d30 - stable/14 - vendor/bc: upgrade to version 7.0.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 90ea553a0d309acc3bdb50a3fe2ed0449c8d7e4c Auto-Submitted: auto-generated The branch stable/14 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=90ea553a0d309acc3bdb50a3fe2ed0449c8d7e4c commit 90ea553a0d309acc3bdb50a3fe2ed0449c8d7e4c Author: Stefan Eßer AuthorDate: 2024-09-18 05:55:46 +0000 Commit: Stefan Eßer CommitDate: 2024-09-24 16:33:30 +0000 vendor/bc: upgrade to version 7.0.2 This update fixes exiting from an interactive bc session with ^D on FreeBSD and Linux when using editline. This bug was caused by the macOS fix for editline in version 7.0.0, which has been reverted in this version. Reported by: mack@macktronics.com (cherry picked from commit c2c85f88902d18d2e9702381f1628112e15a5c3c) (cherry picked from commit 9b04aee86ccd58a6f3c936e0cd95bb9305a69848) --- contrib/bc/NEWS.md | 8 ++++++++ contrib/bc/include/history.h | 24 ++++++++++++++++++++++++ contrib/bc/include/version.h | 2 +- contrib/bc/manuals/bc/A.1 | 6 +++--- contrib/bc/manuals/bc/A.1.md | 4 ++-- contrib/bc/manuals/bc/E.1 | 2 +- contrib/bc/manuals/bc/EH.1 | 2 +- contrib/bc/manuals/bc/EHN.1 | 2 +- contrib/bc/manuals/bc/EN.1 | 2 +- contrib/bc/manuals/bc/H.1 | 6 +++--- contrib/bc/manuals/bc/H.1.md | 4 ++-- contrib/bc/manuals/bc/HN.1 | 6 +++--- contrib/bc/manuals/bc/HN.1.md | 4 ++-- contrib/bc/manuals/bc/N.1 | 6 +++--- contrib/bc/manuals/bc/N.1.md | 4 ++-- contrib/bc/src/history.c | 13 ++++++++++++- 16 files changed, 69 insertions(+), 26 deletions(-) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 8156b673ce04..e3b1f9ecb7bc 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,13 @@ # News +## 7.0.2 + +This is a production release that fixes `Ctrl+d` on FreeBSD and Linux when using +`editline`. + +This bug was caused by the macOS fix in `7.0.0`. Unfortunately, this means that +macOS does not respond properly to `Ctrl+d`. + ## 7.0.1 This is a production release that fixes a warning using GCC on FreeBSD. diff --git a/contrib/bc/include/history.h b/contrib/bc/include/history.h index 460524bd7b87..13f6dc6e985c 100644 --- a/contrib/bc/include/history.h +++ b/contrib/bc/include/history.h @@ -120,6 +120,30 @@ typedef struct BcHistory extern const char bc_history_editrc[]; extern const size_t bc_history_editrc_len; +#ifdef __APPLE__ + +/** + * Returns true if the line is a valid line, false otherwise. + * @param line The line. + * @param len The length of the line. + * @return True if the line is valid, false otherwise. + */ +#define BC_HISTORY_INVALID_LINE(line, len) \ + ((line) == NULL && ((len) == -1 || errno == EINTR)) + +#else // __APPLE__ + +/** + * Returns true if the line is a valid line, false otherwise. + * @param line The line. + * @param len The length of the line. + * @return True if the line is valid, false otherwise. + */ +#define BC_HISTORY_INVALID_LINE(line, len) \ + ((line) == NULL && (len) == -1 && errno == EINTR) + +#endif // __APPLE__ + #else // BC_ENABLE_EDITLINE #if BC_ENABLE_READLINE diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 4d2f6acfb433..a4fb8def5024 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 7.0.1 +#define VERSION 7.0.2 #endif // BC_VERSION_H diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index 4750598b55fc..adeb62f82e6a 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index 56f7c52fb2cd..e89305b1af44 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index 62b18165fe92..e2f1b034e69a 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1 index 69f28e875990..c132a0b76a49 100644 --- a/contrib/bc/manuals/bc/EH.1 +++ b/contrib/bc/manuals/bc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1 index fb453b05363d..e3395b1cc20d 100644 --- a/contrib/bc/manuals/bc/EHN.1 +++ b/contrib/bc/manuals/bc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1 index 4833e3e70ddc..c1ccbec567ec 100644 --- a/contrib/bc/manuals/bc/EN.1 +++ b/contrib/bc/manuals/bc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/bc/H.1 b/contrib/bc/manuals/bc/H.1 index 4787435ae052..9dc46ee50dee 100644 --- a/contrib/bc/manuals/bc/H.1 +++ b/contrib/bc/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" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/H.1.md b/contrib/bc/manuals/bc/H.1.md index aa313cd14b63..fbc0658d8171 100644 --- a/contrib/bc/manuals/bc/H.1.md +++ b/contrib/bc/manuals/bc/H.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/manuals/bc/HN.1 b/contrib/bc/manuals/bc/HN.1 index 73c243310d5c..7b4577f2dbd3 100644 --- a/contrib/bc/manuals/bc/HN.1 +++ b/contrib/bc/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" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/HN.1.md b/contrib/bc/manuals/bc/HN.1.md index dc537ffe4cfa..015035c14daf 100644 --- a/contrib/bc/manuals/bc/HN.1.md +++ b/contrib/bc/manuals/bc/HN.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/manuals/bc/N.1 b/contrib/bc/manuals/bc/N.1 index f66ae06d9c3a..193e0d15f6fb 100644 --- a/contrib/bc/manuals/bc/N.1 +++ b/contrib/bc/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" "January 2024" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "August 2024" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -1731,7 +1731,7 @@ Functions\f[R] subsection below). .RE .TP \f[B]frand(p)\f[R] -Generates a pseudo\-random integer between \f[B]0\f[R] (inclusive) and +Generates a pseudo\-random number between \f[B]0\f[R] (inclusive) and \f[B]1\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. If \f[B]p\f[R] is not \f[B]0\f[R], then calling this function will @@ -1740,7 +1740,7 @@ If \f[B]p\f[R] is \f[B]0\f[R], then \f[B]0\f[R] is returned, and \f[B]seed\f[R] is \f[I]not\f[R] changed. .TP \f[B]ifrand(i, p)\f[R] -Generates a pseudo\-random integer that is between \f[B]0\f[R] +Generates a pseudo\-random number that is between \f[B]0\f[R] (inclusive) and the truncated absolute value of \f[B]i\f[R] (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of \f[B]p\f[R]. diff --git a/contrib/bc/manuals/bc/N.1.md b/contrib/bc/manuals/bc/N.1.md index ad1e603392ae..859c32e3e774 100644 --- a/contrib/bc/manuals/bc/N.1.md +++ b/contrib/bc/manuals/bc/N.1.md @@ -1433,7 +1433,7 @@ The extended library is a **non-portable extension**. **frand(p)** -: Generates a pseudo-random integer between **0** (inclusive) and **1** +: Generates a pseudo-random number between **0** (inclusive) and **1** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If **p** is not **0**, then calling this function will change the value of **seed**. If **p** is **0**, @@ -1441,7 +1441,7 @@ The extended library is a **non-portable extension**. **ifrand(i, p)** -: Generates a pseudo-random integer that is between **0** (inclusive) and the +: Generates a pseudo-random number that is between **0** (inclusive) and the truncated absolute value of **i** (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of **p**. If the absolute value of **i** is greater than or equal to **2**, and diff --git a/contrib/bc/src/history.c b/contrib/bc/src/history.c index 6ae9785d9a79..32a19f71d777 100644 --- a/contrib/bc/src/history.c +++ b/contrib/bc/src/history.c @@ -264,7 +264,18 @@ bc_history_line(BcHistory* h, BcVec* vec, const char* prompt) errno = EINTR; // Get the line. - while (line == NULL && (len == -1 || errno == EINTR)) + // + // XXX: Why have a macro here? Because macOS needs to be special. Honestly, + // it's starting to feel special like Windows at this point. Anyway, the + // second SIGWINCH signal of multiple will return a valid line length on + // macOS, so we need to allow for that on macOS. However, FreeBSD's editline + // is different and will mess up the terminal if we do it that way. + // + // There is one limitation with this, however: Ctrl+D won't work on macOS. + // But it's because of macOS that this problem exists, and I can't really do + // anything about it. So macOS should fix their broken editline; once they + // do, I'll fix Ctrl+D on macOS. + while (BC_HISTORY_INVALID_LINE(line, len)) { line = el_gets(h->el, &len); bc_history_use_prompt = false;