spacecheck.pl: when detecting unicode, mention line number

Closes #18120
This commit is contained in:
Daniel Stenberg 2025-07-31 17:10:12 +02:00
parent 902262b166
commit e688fe18a9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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) {