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 3EA6D15808B for ; Sat, 5 Oct 2024 04:15:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AFF9EE29F0; Sat, 5 Oct 2024 04:15:27 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 6A184E29F0 for ; Sat, 5 Oct 2024 04:15:27 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 88F98340813 for ; Sat, 5 Oct 2024 04:15:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CCFB927F9 for ; Sat, 5 Oct 2024 04:15:22 +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: <1724355466.f60b038e3ae789d01b38eb44ed15dc44ad78bf7c.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: f60b038e3ae789d01b38eb44ed15dc44ad78bf7c X-VCS-Branch: master Date: Sat, 5 Oct 2024 04:15:22 +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: 86131f41-8b5a-4dc8-add5-497ac64a6e66 X-Archives-Hash: 4e879214789f0b5f8662f053f5b20d55 commit: f60b038e3ae789d01b38eb44ed15dc44ad78bf7c Author: Kerin Millar plushkava net> AuthorDate: Sat Aug 17 18:25:22 2024 +0000 Commit: Sam James gentoo org> CommitDate: Thu Aug 22 19:37:46 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=f60b038e Double quote a ${parameter+word} expansion in defer() Doing so protects against the following scenario. $ IFS=e word=1 $ set -x; test ${word+set} + test s t dash: 2: test: s: unexpected operator Signed-off-by: Kerin Millar plushkava.net> functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index 3dd2969..8180182 100644 --- a/functions.sh +++ b/functions.sh @@ -175,7 +175,7 @@ deref() elif ! trueof_all is_identifier -- "$@"; then _warn_for_args deref "$@" false - elif ! eval "test \${$1+set}"; then + elif ! eval "test \"\${$1+set}\""; then false elif [ "$#" -eq 1 ]; then eval "printf '%s\\n' \"\$$1\""