From eb1ea3ee196d8dbb69950e87cf3651daa8c0fd83 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Mar 2023 19:00:08 +0900 Subject: [PATCH] lib/utils (_omb_util_glob_expand): Fix shopt restoration failure (fixup f6d6dcc, fix #416) https://github.com/ohmybash/oh-my-bash/issues/416 --- lib/utils.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/utils.sh b/lib/utils.sh index 99d2794..049c44f 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -285,15 +285,16 @@ function pushover { } ## @fn _omb_util_get_shopt optnames... +## @var[out] __shopt if ((_omb_bash_version >= 40100)); then - function _omb_util_get_shopt { shopt=$BASHOPTS; } + function _omb_util_get_shopt { __shopt=$BASHOPTS; } else function _omb_util_get_shopt { - shopt= + __shopt= local opt for opt; do if shopt -q "$opt" &>/dev/null; then - shopt=${shopt:+$shopt:}$opt + __shopt=${__shopt:+$__shopt:}$opt fi done }