init.sh setvars: make err a printf for eval

setvars is always invoked with eval, so make the error
condition a message for eval, to ensure that it is reliably
handled, in case of error condition.

Signed-off-by: Leah Rowe <leah@libreboot.org>
25.04_branch
Leah Rowe 2025-04-26 22:07:52 +01:00
parent 3221ca7742
commit ef78f88117
1 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,11 @@ err="err_"
setvars()
{
_setvars="" && [ $# -lt 2 ] && $err "setvars: too few arguments"
_setvars=""
if [ $# -lt 2 ]; then
printf "\$err \"setvars: too few args\""
return 0
fi
val="$1" && shift 1 && for var in "$@"; do
_setvars="$var=\"$val\"; $_setvars"
done