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 7280B158008 for ; Wed, 14 Jun 2023 17:40:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 83BFEE08E2; Wed, 14 Jun 2023 17:40:51 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 49268E08C8 for ; Wed, 14 Jun 2023 17:40:51 +0000 (UTC) From: =?UTF-8?q?Ulrich=20M=C3=BCller?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Ulrich=20M=C3=BCller?= Subject: [gentoo-dev] [PATCH] estack.eclass: Fix bug in eshopts_push() Date: Wed, 14 Jun 2023 19:39:59 +0200 Message-ID: <20230614174009.24963-1-ulm@gentoo.org> X-Mailer: git-send-email 2.41.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 170203b4-44bf-495d-aab2-37f5f2e5b540 X-Archives-Hash: 8a91647a4a3ebca40625fb565b12d6b8 "eshopts_push -s autocd; eshopts_pop" (i.e. the first option listed by "shopt -p") would not restore the option because of bogus whitespace in the saved string. Signed-off-by: Ulrich Müller --- eclass/estack.eclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eclass/estack.eclass b/eclass/estack.eclass index c0823adb03f7..d00c931e117d 100644 --- a/eclass/estack.eclass +++ b/eclass/estack.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: estack.eclass @@ -156,7 +156,7 @@ evar_pop() { eshopts_push() { # Save both "shopt" and "set -o" option sets, because otherwise # restoring posix would disable expand_aliases by side effect. #662586 - estack_push eshopts "$(shopt -p -o) $(shopt -p)" + estack_push eshopts "$(shopt -p -o; shopt -p)" if [[ $1 == -[su] ]] ; then [[ $# -le 1 ]] && return 0 shopt "$@" || die "${FUNCNAME}: bad options to shopt: $*" -- 2.41.0