]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
spacecheck.pl: when detecting unicode, mention line number
authorDaniel Stenberg <daniel@haxx.se>
Thu, 31 Jul 2025 15:10:12 +0000 (17:10 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 31 Jul 2025 21:29:17 +0000 (23:29 +0200)
Closes #18120

.github/scripts/spacecheck.pl

index 10bd2fc8ed76a1a8ed3f0a66768852877a933faa..a50b260bf5f390034fe5191e744bd5da003b24c7 100755 (executable)
@@ -167,7 +167,13 @@ while(my $filename = <$git_ls_files>) {
         for my $e (split(//, $non)) {
             $hex .= sprintf("%s%02x", $hex ? " ": "", ord($e));
         }
-        push @err, "content: has non-ASCII: '$non' ($hex)";
+        my $line;
+        for my $l (split(/\n/, $content)) {
+            $line++;
+            if($l =~ /([\x80-\xff]+)/) {
+                push @err, "line $line: has non-ASCII: '$non' ($hex)";
+            }
+        }
     }
 
     if(@err) {