From 605f44c3a25eecd50efb6cf48d04f62177ae4643 Mon Sep 17 00:00:00 2001 From: "Lucas C. Villa Real" Date: Sun, 26 Mar 2017 00:07:34 -0300 Subject: [PATCH] The argument to "test -n" must be quoted, otherwise we get a bogus "true" response to the test. --- Functions/Compile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Functions/Compile b/Functions/Compile index 20068723..a936f843 100644 --- a/Functions/Compile +++ b/Functions/Compile @@ -39,10 +39,8 @@ function Verify_Files() { local sums=($3) local use_sha=($4) if [ $use_sha == 1 ] - then - Get_Sum="Get_SHA" - else - Get_Sum="Get_MD5" + then Get_Sum="Get_SHA" + else Get_Sum="Get_MD5" fi for i in $(seq 0 $[${#myfiles[@]}-1]) do @@ -312,11 +310,9 @@ function do_fetch() { } else # Use sha checksum if available - if [ -n ${file_shas} ]; - then - Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_shas[*]}" 1 - else - Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_md5s[*]}" 0 + if [ -n "${file_shas}" ]; + then Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_shas[*]}" 1 + else Verify_Files "${files[*]}" "${file_sizes[*]}" "${file_md5s[*]}" 0 fi result=$? case $result in