commit:     1c584e31cf0861c94332a5350614912b073616bc
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 11 20:33:09 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Jan 11 20:33:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c584e31

optfeature.eclass: [QA] Fix unwanted globbing

Closes: https://bugs.gentoo.org/498988
Reported-by: Mike Frysinger <vapier <AT> gentoo.org>
Suggested-by: Ulrich Müller <ulm <AT> gentoo.org>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 eclass/optfeature.eclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eclass/optfeature.eclass b/eclass/optfeature.eclass
index 1943ae37bf5..e13fc3eba81 100644
--- a/eclass/optfeature.eclass
+++ b/eclass/optfeature.eclass
@@ -32,11 +32,13 @@ optfeature() {
        debug-print-function ${FUNCNAME} "$@"
 
        local i j msg
+       local -a arr
        local desc=$1
        local flag=0
        shift
        for i; do
-               for j in ${i}; do
+               read -r -d '' -a arr <<<"${i}"
+               for j in "${arr[@]}"; do
                        if has_version "${j}"; then
                                flag=1
                        else
@@ -50,8 +52,9 @@ optfeature() {
        done
        if [[ ${flag} -eq 0 ]]; then
                for i; do
+                       read -r -d '' -a arr <<<"${i}"
                        msg=" "
-                       for j in ${i}; do
+                       for j in "${arr[@]}"; do
                                msg+=" ${j} and"
                        done
                        msg="${msg:0: -4} for ${desc}"

Reply via email to