all.sh: fix missing quotes

Without quotes, when the variable is empty, the shell will see three
tokens: [, -n, ]. After skipping ] as usual, it will see a single token,
so it will consider it not as command, but a string to be tested for "is
it empty", and since "-n" is not empty, the command will return true.

With quotes it see 4 tokens: [, -n, <empty string>, ] and interprets -n
as desired.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard 2024-10-17 09:17:26 +02:00
parent 6c0b4e73c0
commit dea880f035

View File

@ -250,10 +250,10 @@ helper_armc6_build_test()
msg "size: ARM Compiler 6 ($FLAGS)"
"$ARMC6_FROMELF" -z library/*.o
if [ -n ${PSA_CORE_PATH} ]; then
if [ -n "${PSA_CORE_PATH}" ]; then
"$ARMC6_FROMELF" -z ${PSA_CORE_PATH}/*.o
fi
if [ -n ${BUILTIN_SRC_PATH} ]; then
if [ -n "${BUILTIN_SRC_PATH}" ]; then
"$ARMC6_FROMELF" -z ${BUILTIN_SRC_PATH}/*.o
fi
}