Fixed a bug with returning from entering a hash path.

The bug was caused by using $? with an if block, to get the result of the
subroutine tested by that same if conditional. This was always evalutating
to the error code given before the conditional, which was 0 (success).
This commit is contained in:
Matias Barcenas 2018-03-13 18:56:49 -05:00
parent a5de81c5b0
commit 546774f4c5
1 changed files with 3 additions and 1 deletions

View File

@ -1507,7 +1507,9 @@ fluxion_hash_get_path() {
while true; do
fluxion_hash_unset_path
if ! fluxion_hash_set_path "$@"; then return $?; fi
if ! fluxion_hash_set_path "$@"; then
return -1 # WARNING: The recent error code is NOT contained in $? here!
fi
if fluxion_hash_verify "$FluxionHashPath" "$2" "$3"; then
break;