diff options
author | John Ericson <Ericson2314@yahoo.com> | 2018-02-21 17:00:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-21 17:00:42 -0500 |
commit | e42e6d2f0e58c4b1fcaff67d44f3fe015de689a4 (patch) | |
tree | 75e8138e7b6415d48a35bd4136a6524705e7fe84 /pkgs/build-support | |
parent | b5391b24518a5697f1f0489ace2e44f9c4015b2e (diff) | |
parent | 9a9c2e65791d8f8a07b2b3b1555f633d47520197 (diff) |
Merge pull request #35266 from abbradar/cc-bools
cc-wrapper: fix bool handling for empty and zero values
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/cc-wrapper/utils.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/build-support/cc-wrapper/utils.sh b/pkgs/build-support/cc-wrapper/utils.sh index 4b2b13809181e..9215fe2dc397c 100644 --- a/pkgs/build-support/cc-wrapper/utils.sh +++ b/pkgs/build-support/cc-wrapper/utils.sh @@ -25,7 +25,11 @@ mangleVarBool() { for infix in "${role_infixes[@]}"; do local inputVar="${var/+/${infix}}" if [ -v "$inputVar" ]; then - let "${outputVar} |= ${!inputVar}" + # "1" in the end makes `let` return success error code when + # expression itself evaluates to zero. + # We don't use `|| true` because that would silence actual + # syntax errors from bad variable values. + let "${outputVar} |= ${!inputVar:-0}" "1" fi done } |