From 7f84b9ab92f5bf3440eecc875e55b9a53127c9c5 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 12 Apr 2022 20:33:13 -0700 Subject: [scripts/functions]: Fix quoting issue in comparison On my Ubuntu machine (with `dash` version `0.5.10` and `bash` version `5.0.17`), I would get errors such as the following: ``` crosstool-ng/scripts/functions: line 730: [: !=: unary operator expected ``` This is generally because a variable is not set, and expands to an empty string causing the test operator to mis-parse the expression. To fix this, I have added quotes around the variable. Signed-off-by: Elliot Saba --- scripts/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/functions b/scripts/functions index 24463428..5874c854 100644 --- a/scripts/functions +++ b/scripts/functions @@ -727,7 +727,7 @@ CT_DoGetFile() rm -f "${tmp}" # Replace a special value of '-1' with empty string - if [ ${CT_CONNECT_TIMEOUT} != -1 ]; then + if [ "${CT_CONNECT_TIMEOUT}" != -1 ]; then T="${CT_CONNECT_TIMEOUT}" fi -- cgit v1.2.3