lib/utils (_omb_util_glob_expand): Fix shopt restoration failure (fixup f6d6dcc, fix #416)

https://github.com/ohmybash/oh-my-bash/issues/416
This commit is contained in:
Koichi Murase
2023-03-13 19:00:08 +09:00
parent 96f6e00c38
commit eb1ea3ee19

View File

@@ -285,15 +285,16 @@ function pushover {
} }
## @fn _omb_util_get_shopt optnames... ## @fn _omb_util_get_shopt optnames...
## @var[out] __shopt
if ((_omb_bash_version >= 40100)); then if ((_omb_bash_version >= 40100)); then
function _omb_util_get_shopt { shopt=$BASHOPTS; } function _omb_util_get_shopt { __shopt=$BASHOPTS; }
else else
function _omb_util_get_shopt { function _omb_util_get_shopt {
shopt= __shopt=
local opt local opt
for opt; do for opt; do
if shopt -q "$opt" &>/dev/null; then if shopt -q "$opt" &>/dev/null; then
shopt=${shopt:+$shopt:}$opt __shopt=${__shopt:+$__shopt:}$opt
fi fi
done done
} }