From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 290521581D3 for ; Tue, 14 May 2024 00:05:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F2936E2A95; Tue, 14 May 2024 00:05:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D128EE2A2D for ; Tue, 14 May 2024 00:05:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 123C6335DC3 for ; Tue, 14 May 2024 00:05:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 488191AAB for ; Tue, 14 May 2024 00:05:20 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1715638754.520388fda047e61a04802faf86a3d8d850cc58dc.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh.in X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 520388fda047e61a04802faf86a3d8d850cc58dc X-VCS-Branch: master Date: Tue, 14 May 2024 00:05:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b1d0ade0-5f1a-4018-9b56-f0ebdb8b018e X-Archives-Hash: b1d9616fda7ef81f1c5cb2a9b23c4049 commit: 520388fda047e61a04802faf86a3d8d850cc58dc Author: Kerin Millar plushkava net> AuthorDate: Mon May 13 21:56:09 2024 +0000 Commit: Sam James gentoo org> CommitDate: Mon May 13 22:19:14 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=520388fd Render _update_winsize() immune to the prevailing value of IFS Signed-off-by: Kerin Millar plushkava.net> functions.sh.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions.sh.in b/functions.sh.in index d1df518..555d1d1 100644 --- a/functions.sh.in +++ b/functions.sh.in @@ -638,12 +638,17 @@ _update_tty_level() _update_winsize() { + local ifs + # The following use of stty(1) is portable as of POSIX Issue 8. It would # be beneficial to leverage the checkwinsize option in bash but the # implementation is buggy. Given that Chet has agreed to investigate, # it may eventually become possible to support it. + ifs=$IFS + IFS=' ' # shellcheck disable=2046 set -- $(stty size 2>/dev/null) + IFS=$ifs if [ "$#" -eq 2 ] && is_int "$1" && is_int "$2" && [ "$1" -gt 0 ] && [ "$2" -gt 0 ]; then genfun_rows=$1 genfun_cols=$2