]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc.pl: fix handling .checksrc with CRLF
authorEvgeny Grin <k2k@narod.ru>
Sun, 18 Feb 2024 06:36:27 +0000 (11:36 +0500)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 18 Feb 2024 06:59:44 +0000 (01:59 -0500)
- When parsing .checksrc chomp the (CR)LF line ending.

Prior to this change on Windows checksrc.pl would not process the
symbols in .checksrc properly, since many git repos in Windows use auto
crlf to check out files with CRLF line endings.

Closes https://github.com/curl/curl/pull/12924

scripts/checksrc.pl

index 76f4660816d749e714751ab344d272a459a19268..be085e0613007914a8222da1187727478b5079b9 100755 (executable)
@@ -120,6 +120,7 @@ sub readlocalfile {
     open(my $rcfile, "<", "$dir/.checksrc") or return;
 
     while(<$rcfile>) {
+        $windows_os ? $_ =~ s/\r?\n$// : chomp;
         $i++;
 
         # Lines starting with '#' are considered comments