From c75ca20c0a6c6f3d7993d2ee9786d0451df5c6a4 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 19 Dec 2023 02:31:44 +0000 Subject: 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 --- include/option.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/option.sh b/include/option.sh index ed094b5c..b6e22ce8 100755 --- a/include/option.sh +++ b/include/option.sh @@ -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 -- cgit v1.2.1