Skip to content

Commit 83dae01

Browse files
committed
Merge branch 'old-compilers-fix' of https://github.com/matthijskooijman/arduino-builder
Signed-off-by: Cristian Maglie <c.maglie@arduino.cc>
2 parents a47cf2a + 5a79106 commit 83dae01

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/arduino.cc/builder/includes_finder_with_regexp.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ func (s *IncludesFinderWithRegExp) Run(ctx *types.Context) error {
6363
}
6464

6565
func findIncludesForOldCompilers(source string) string {
66-
firstLine := strings.Split(source, "\n")[0]
67-
splittedLine := strings.Split(firstLine, ":")
68-
for i, _ := range splittedLine {
69-
if strings.Contains(splittedLine[i], "fatal error") {
70-
return strings.TrimSpace(splittedLine[i+1])
66+
lines := strings.Split(source, "\n")
67+
for _, line := range lines {
68+
splittedLine := strings.Split(line, ":")
69+
for i, _ := range splittedLine {
70+
if strings.Contains(splittedLine[i], "fatal error") {
71+
return strings.TrimSpace(splittedLine[i+1])
72+
}
7173
}
7274
}
7375
return ""

0 commit comments

Comments
 (0)