lib/utils (_omb_util_glob_expand): Avoid variable name conflicts

This commit is contained in:
Koichi Murase
2023-03-13 00:10:02 +09:00
parent ec7efa5628
commit f6d6dccfa1
+7 -7
View File
@@ -364,7 +364,7 @@ function _omb_util_add_prompt_command {
} }
function _omb_util_glob_expand { function _omb_util_glob_expand {
local set=$- shopt gignore=$GLOBIGNORE local __set=$- __shopt __gignore=$GLOBIGNORE
_omb_util_get_shopt failglob nullglob extglob _omb_util_get_shopt failglob nullglob extglob
shopt -u failglob shopt -u failglob
@@ -375,17 +375,17 @@ function _omb_util_glob_expand {
eval -- "$1=($2)" eval -- "$1=($2)"
GLOBIGNORE=$gignore GLOBIGNORE=$__gignore
# Note: dotglob is changed by GLOBIGNORE # Note: dotglob is changed by GLOBIGNORE
if [[ :$shopt: == *:dotglob:* ]]; then if [[ :$__shopt: == *:dotglob:* ]]; then
shopt -s dotglob shopt -s dotglob
else else
shopt -u dotglob shopt -u dotglob
fi fi
[[ $set == *f* ]] && set -f [[ $__set == *f* ]] && set -f
[[ :$shopt: != *:extglob:* ]] && shopt -u extglob [[ :$__shopt: != *:extglob:* ]] && shopt -u extglob
[[ :$shopt: != *:nullglob:* ]] && shopt -u nullglob [[ :$__shopt: != *:nullglob:* ]] && shopt -u nullglob
[[ :$shopt: == *:failglob:* ]] && shopt -s failglob [[ :$__shopt: == *:failglob:* ]] && shopt -s failglob
return 0 return 0
} }