Skip to content

Commit 7ff1de1

Browse files
committed
convert intermediate file EOLs to pure \n format
otherwise all processing on ino file will likely fail solves #114
1 parent 4d20d6d commit 7ff1de1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/arduino.cc/builder/prototypes_adder.go

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ type PrototypesAdder struct{}
4343
func (s *PrototypesAdder) Run(context map[string]interface{}) error {
4444
debugOutput := context[constants.CTX_DEBUG_PREPROCESSOR] != nil
4545
source := context[constants.CTX_SOURCE].(string)
46+
47+
source = strings.Replace(source, "\r\n", "\n", -1)
48+
source = strings.Replace(source, "\r", "\n", -1)
49+
4650
sourceRows := strings.Split(source, "\n")
4751

4852
if !utils.MapHas(context, constants.CTX_LINE_WHERE_TO_INSERT_PROTOTYPES) {

0 commit comments

Comments
 (0)