checksrc: quote the file name to work with "funny" letters

Closes #11437
This commit is contained in:
Daniel Stenberg 2023-07-13 13:50:31 +02:00
parent 049e96da94
commit b87e0921e0
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -912,12 +912,12 @@ sub scanfile {
@copyright = sort {$$b{year} cmp $$a{year}} @copyright;
# if the file is modified, assume commit year this year
if(`git status -s -- $file` =~ /^ [MARCU]/) {
if(`git status -s -- "$file"` =~ /^ [MARCU]/) {
$commityear = (localtime(time))[5] + 1900;
}
else {
# min-parents=1 to ignore wrong initial commit in truncated repos
my $grl = `git rev-list --max-count=1 --min-parents=1 --timestamp HEAD -- $file`;
my $grl = `git rev-list --max-count=1 --min-parents=1 --timestamp HEAD -- "$file"`;
if($grl) {
chomp $grl;
$commityear = (localtime((split(/ /, $grl))[0]))[5] + 1900;