@@ -, +, @@ flag-o-matic: remove array dereferencing and avoid unsafe expansions in _is_flaq() Now that strip-flags() no longer attempts to erroneously use the array dereferencing feature of _is_flagq(), we can remove support for it altogether. Additionally, quote expansions properly and use read to split the scalar containing the flag list, thus avoiding the potentially harmful effects of globbing and pathname expansion. $2 remains unquoted, as it must be treated as a glob. --- a/eclass/flag-o-matic.eclass +++ a/eclass/flag-o-matic.eclass @@ -295,8 +295,10 @@ replace-cpu-flags() { } _is_flagq() { - local x var="$1[*]" - for x in ${!var} ; do + local x + local -a flags + read -ra flags <<<"${!1}" + for x in "${flags[@]}"; do [[ ${x} == $2 ]] && return 0 done return 1