diff --git a/check-style.sh b/check-style.sh index 2d3626d..2f88963 100755 --- a/check-style.sh +++ b/check-style.sh @@ -42,7 +42,15 @@ case $1 in esac # Filter out symlinks from `affected_files`. We'll check the real files. -affected_files=$(echo "$affected_files" | xargs -r -n1 file | grep -v 'symbolic link' | cut -d: -f1 | tr '\n' ' ') +# Use bash test operators instead of the 'file' command to avoid issues with +# filenames containing special characters (colons, commas, etc). +filtered_files="" +for f in $affected_files; do + if [ ! -L "$f" ]; then + filtered_files="$filtered_files $f" + fi +done +affected_files=$(echo "$filtered_files" | xargs -r) # Unset variable would be a sign of programmer error. We are not using '-e' in # this script as we'd like to handle these cases ourselves where relevant, i.e.,