Skip to content

Commit d28737d

Browse files
committed
Ignore CR+LF in dep parser
1 parent c34995b commit d28737d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/arduino/builder/cpp/depfile.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func ReadDepFile(depFilePath *paths.Path) (*Dependencies, error) {
5555
}
5656

5757
func readDepFile(depFile string) (*Dependencies, error) {
58-
rows, err := unescapeAndSplit(strings.ReplaceAll(depFile, "\r\n", "\n"))
58+
rows, err := unescapeAndSplit(depFile)
5959
if err != nil {
6060
return nil, err
6161
}
@@ -83,6 +83,10 @@ func unescapeAndSplit(s string) ([]string, error) {
8383
dollar := false
8484
current := strings.Builder{}
8585
for _, c := range s {
86+
if c == '\r' {
87+
// Ignore CR (Windows line ending style immediately followed by LF)
88+
continue
89+
}
8690
if backslash {
8791
switch c {
8892
case ' ':

0 commit comments

Comments
 (0)