get.sh: Make xbmkget err on exiting the loop check

The idea in this function is that if a file or repo is
successfully handled, a return will be performed from the
loop.

If the loop exits for any reason, an error is thrown. The
current code is probably fine, but I can forsee future
modifications possibly causing bugs here.

Make it unambiguous, by always throwing an error if execution
reaches the end of the function.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-19 22:59:20 +01:00
parent 900da04efa
commit 620c1dd6fa
+2 -1
View File
@@ -87,7 +87,8 @@ xbmkget()
for url in "$2" "$3"; do
[ -n "$url" ] && try_file "$url" "$@" && \
eval "[ -$echk \"$4\" ] && return 0"
done && err "$1 $2 $3 $4: not downloaded"; :
done
err "$1 $2 $3 $4: not downloaded"; :
}
try_file()