diff options
author | Leah Rowe <leah@libreboot.org> | 2023-12-19 02:31:44 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-12-19 02:32:30 +0000 |
commit | c75ca20c0a6c6f3d7993d2ee9786d0451df5c6a4 (patch) | |
tree | 39504a4e0d4058e73e4ec47e4a178e75682979a1 /include/option.sh | |
parent | 578f105d62e088574ff8fecdc5d2e342e69335e7 (diff) |
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>
Diffstat (limited to 'include/option.sh')
-rwxr-xr-x | include/option.sh | 7 |
1 files 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 |