From 546774f4c5562e07cae3b8f5afbc9f076561dfde Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Tue, 13 Mar 2018 18:56:49 -0500 Subject: [PATCH] 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). --- fluxion.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fluxion.sh b/fluxion.sh index 319915e..5986813 100755 --- a/fluxion.sh +++ b/fluxion.sh @@ -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;