From f6d6dccfa1f53b47d6f2490bff3031cb8e8c512e Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Mar 2023 00:07:08 +0900 Subject: [PATCH] lib/utils (_omb_util_glob_expand): Avoid variable name conflicts --- lib/utils.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/utils.sh b/lib/utils.sh index 7c98986..99d2794 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -364,7 +364,7 @@ function _omb_util_add_prompt_command { } function _omb_util_glob_expand { - local set=$- shopt gignore=$GLOBIGNORE + local __set=$- __shopt __gignore=$GLOBIGNORE _omb_util_get_shopt failglob nullglob extglob shopt -u failglob @@ -375,17 +375,17 @@ function _omb_util_glob_expand { eval -- "$1=($2)" - GLOBIGNORE=$gignore + GLOBIGNORE=$__gignore # Note: dotglob is changed by GLOBIGNORE - if [[ :$shopt: == *:dotglob:* ]]; then + if [[ :$__shopt: == *:dotglob:* ]]; then shopt -s dotglob else shopt -u dotglob fi - [[ $set == *f* ]] && set -f - [[ :$shopt: != *:extglob:* ]] && shopt -u extglob - [[ :$shopt: != *:nullglob:* ]] && shopt -u nullglob - [[ :$shopt: == *:failglob:* ]] && shopt -s failglob + [[ $__set == *f* ]] && set -f + [[ :$__shopt: != *:extglob:* ]] && shopt -u extglob + [[ :$__shopt: != *:nullglob:* ]] && shopt -u nullglob + [[ :$__shopt: == *:failglob:* ]] && shopt -s failglob return 0 }