vendor.sh: re-do the previously reverted change

but do it better. this time, the change won't cause any
behavioural differences.

the reason for the change is we don't want "$@" inside
an eval statement, if such calamity can be avoided.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-10-04 16:43:37 +01:00
parent 2956fcc051
commit 31fa7ea591
+11 -2
View File
@@ -490,9 +490,18 @@ extract_fsp()
setvfile() setvfile()
{ {
[ -n "$vcfg" ] && for c in $checkvarschk; do [ -n "$vcfg" ] && for c in $checkvarschk
do
do_getvfile="n"
vcmd="[ \"\${$c}\" != \"/dev/null\" ] && [ -n \"\${$c}\" ]" vcmd="[ \"\${$c}\" != \"/dev/null\" ] && [ -n \"\${$c}\" ]"
eval "$vcmd && getvfile \"\$@\" && return 0"
eval "$vcmd && do_getvfile=\"y\""
if [ "$do_getvfile" = "y" ]; then
if getvfile "$@"; then
return 0
fi
fi
done && return 1; : done && return 1; :
} }