aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-07-22 01:51:01 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-07-22 01:51:01 -0400
commit5e3dcd8f29cf4ad653e69d50e1500a330bba8ca8 (patch)
tree6ab2c8545571229d2f4c0dda5ee7976d47cf078f /libs
parent6e92244e0cc9a3b08cfcca8bd85990f795abb83e (diff)
downloadlibrebootfr-5e3dcd8f29cf4ad653e69d50e1500a330bba8ca8.tar.gz
librebootfr-5e3dcd8f29cf4ad653e69d50e1500a330bba8ca8.zip
Remove IFS binding masking a non-zero status code
In project_action_arguments_recursive(), IFS bindings needed to be reworked in order to avoid a situation where, for example, project_extract() would fail to extract source archives (because they didn't exist), returning a status code of 1 only for it to be masked by a rebinding of IFS--which would always succeed. ifs_save and IFS were made local variables in project_action_arguments_recursive() in order to avoid the need to rebind IFS after the for loop returns. This patch makes './libreboot sources <project>' functional.
Diffstat (limited to 'libs')
-rwxr-xr-xlibs/project9
1 files changed, 3 insertions, 6 deletions
diff --git a/libs/project b/libs/project
index 8eaf0d2d..728b9118 100755
--- a/libs/project
+++ b/libs/project
@@ -187,16 +187,15 @@ project_action_arguments_recursive() {
local action_helper_arguments
local argument
- local ifs_save
action_helper_arguments="$(project_action_helper 'arguments' "${project}" "$@" || true)"
if [[ -z "${action_helper_arguments}" ]]; then
project_action "${action}" "${project}" "$@"
else
- # This it to allow space characters in arguments.
- ifs_save="${IFS}"
- IFS=$'\n'
+ # This is to allow space characters in arguments.
+ local ifs_save="${IFS}"
+ local IFS=$'\n'
for argument in $(printf '%s\n' "${action_helper_arguments}")
do
@@ -207,8 +206,6 @@ project_action_arguments_recursive() {
project_action_arguments_recursive "${action}" "${project}" "$@" "${argument}"
)
done
-
- IFS="${ifs_save}"
fi
}