From 50fd6d15b87fedaf4de2aac0c4e11f817087f666 Mon Sep 17 00:00:00 2001 From: Zakhar Date: Mon, 6 Oct 2025 11:04:28 +0000 Subject: [PATCH] Fix the mechanism we use to detect symlinks --- check-style.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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.,