public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] estack.eclass: Fix bug in eshopts_push()
@ 2023-06-14 17:39 Ulrich Müller
  0 siblings, 0 replies; only message in thread
From: Ulrich Müller @ 2023-06-14 17:39 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Müller

"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 <ulm@gentoo.org>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-14 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14 17:39 [gentoo-dev] [PATCH] estack.eclass: Fix bug in eshopts_push() Ulrich Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox