Skip to content

Commit

Permalink
estack.eclass: Fix bug in eshopts_push()
Browse files Browse the repository at this point in the history
"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 <[email protected]>
  • Loading branch information
ulm committed Jun 16, 2023
1 parent bbe1d76 commit 8209b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eclass/estack.eclass
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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: $*"
Expand Down

0 comments on commit 8209b12

Please sign in to comment.