]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
travis/script.sh: fix use of `-n' with unquoted envvar
authorThomas M. DuBuisson <tommd@musedev.io>
Tue, 4 Aug 2020 02:12:34 +0000 (19:12 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 4 Aug 2020 07:51:01 +0000 (09:51 +0200)
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

scripts/travis/script.sh

index b71f20a66b8d0c42a108c16e16ce71570200c1f0..147b6288612c1e0c148d2e18f25d86de5735bd92 100755 (executable)
@@ -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