]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc: quote the file name to work with "funny" letters
authorDaniel Stenberg <daniel@haxx.se>
Thu, 13 Jul 2023 11:50:31 +0000 (13:50 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 13 Jul 2023 12:25:18 +0000 (14:25 +0200)
Closes #11437

scripts/checksrc.pl

index c1ee27966e4243f647a00e7a9a03ac13432b1bdc..c44dbce37a0b7b77470fee48c022248eaebfe756 100755 (executable)
@@ -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;