use(): use set -f and handle IFS
authorZac Medico <zmedico@gentoo.org>
Mon, 10 Sep 2012 19:46:50 +0000 (12:46 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 10 Sep 2012 19:46:50 +0000 (12:46 -0700)
bin/phase-helpers.sh

index 18877f059c4a8512fcf1ae9e2e064ce23ab406c0..bb5e057a7e07f3a9ae862bc2ba2ce7bee0ab1998 100644 (file)
@@ -215,11 +215,15 @@ use() {
                                "in IUSE for ${CATEGORY}/${PF}"
        fi
 
+       local IFS=$' \t\n' prev_shopts=$- ret
+       set -f
        if has ${u} ${USE} ; then
-               return ${found}
+               ret=${found}
        else
-               return $((!found))
+               ret=$((!found))
        fi
+       [[ ${prev_shopts} == *f* ]] || set +f
+       return ${ret}
 }
 
 use_with() {