Fix fake LINT check success (#8092)
authorJozef Behran <jozuejozef@gmail.com>
Sat, 12 Jan 2019 15:15:42 +0000 (10:15 -0500)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Sat, 12 Jan 2019 15:15:42 +0000 (16:15 +0100)
The code 'if [ -z ${something} ]; then ... fi' means "if
${something} is an empty string, yell at the command line
about 'binary operator expected' and ignore the body of the
if statement, if ${something} is not an empty string,
the condition is false so ignore the body of the if
statement" which clearly isn't what the author wanted. Fix
it by adding a few quotes around the offending ${something}.

util/travis/lint.sh

index 1174ed2575177476d6ce7e3ff5b093459da24a1d..887e621f58e90710b5e4a19e5ad5bcc5d246ad3d 100644 (file)
@@ -20,7 +20,7 @@ function perform_lint() {
                        whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST")
 
                        # If file is not whitelisted, mark a failure
-                       if [ -z ${whitelisted} ]; then
+                       if [ -z "${whitelisted}" ]; then
                                errorcount=$((errorcount+1))
 
                                printf "The file %s is not compliant with the coding style" "$f"