From: Thomas M. DuBuisson Date: Tue, 4 Aug 2020 02:12:34 +0000 (-0700) Subject: travis/script.sh: fix use of `-n' with unquoted envvar X-Git-Tag: curl-7_72_0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30974cb895756e159d21403c5960d52f0c55dfd7;p=thirdparty%2Fcurl.git travis/script.sh: fix use of `-n' with unquoted envvar Shellcheck tells us "-n doesn't work with unquoted arguments. quote or use [[ ]]." And testing shows: ``` docker run --rm -it ubuntu bash root@fe85ce156856:/# [ -n $DOES_NOT_EXIST ] && echo "I ran" I ran root@fe85ce156856:/# [ -n "$DOES_NOT_EXIST" ] && echo "I ran" root@fe85ce156856:/# ``` Closes #5773 --- diff --git a/scripts/travis/script.sh b/scripts/travis/script.sh index b71f20a66b..147b628861 100755 --- a/scripts/travis/script.sh +++ b/scripts/travis/script.sh @@ -84,7 +84,7 @@ if [ "$T" = "normal" ]; then if [ -z $NOTESTS ]; then make test-nonflaky fi - if [ -n $CHECKSRC ]; then + if [ -n "$CHECKSRC" ]; then make checksrc fi fi