option.sh: don't rely on zero status on printf

this part of the code *must* return. the for loop
afterwards must not be permitted to execute.

it's unlikely that this would ever occur, unless
perhaps the user is using a very buggy sh.

Signed-off-by: Leah Rowe <leah@libreboot.org>
9020vga
Leah Rowe 2023-12-19 02:31:44 +00:00
parent 578f105d62
commit c75ca20c0a
1 changed files with 4 additions and 3 deletions

View File

@ -20,9 +20,10 @@ eval "$(setvars "" CONFIG_BOARD_DELL_E6400 CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN \
items()
{
rval=1
[ ! -d "${1}" ] && \
printf "items: directory '%s' doesn't exist" "${1}" && \
return 1
if [ ! -d "${1}" ]; then
printf "items: directory '%s' doesn't exist" "${1}"
return 1
fi
for x in "${1}/"*; do
# -e used because this is for files *or* directories
[ -e "${x}" ] || continue