Skip to content

.gitattributes: set .checksrc as LF - #12924

Closed
Karlson2k wants to merge 2 commits into
curl:masterfrom
Karlson2k:gitattributes_fix_01
Closed

Karlson2k wants to merge 2 commits into
curl:masterfrom
Karlson2k:gitattributes_fix_01

Conversation

@Karlson2k

@Karlson2k Karlson2k commented Feb 10, 2024 •

Copy link
Copy Markdown
Contributor

This PR fixes debug builds on Windows.

CRLF line ending in .checksrc files is not handled by scripts/checksrc.pl

@jay

jay commented Feb 18, 2024

Copy link
Copy Markdown
Member

I notice all other file reads in checksrc are handled with $windows_os ? $_ =~ s/\r?\n$// : chomp; so I propose we do that instead:

diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl
index 76f4660..be085e0 100755
--- a/scripts/checksrc.pl
+++ b/scripts/checksrc.pl
@@ -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

@jay jay added the script label Feb 18, 2024
@Karlson2k

Karlson2k commented Feb 18, 2024 •

Copy link
Copy Markdown
Contributor Author

We can use both fixes.
There is no reason to have LF->CRLF transformation in .checksrc files.

@Karlson2k
Karlson2k force-pushed the gitattributes_fix_01 branch from 97619fd to d4d4ece Compare February 18, 2024 06:37
@jay jay closed this in 298c120 Feb 18, 2024
@jay

jay commented Feb 18, 2024

Copy link
Copy Markdown
Member

Thanks. I landed this but omitted the gitattributes change. IMO there's no reason to have a special exception since it can now be handled like the other input files.

@Karlson2k
Karlson2k deleted the gitattributes_fix_01 branch February 18, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants