From 7ff1de12b9e073867e4fd42ddf24604466774a2c Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 8 Feb 2016 17:46:07 +0100 Subject: [PATCH] convert intermediate file EOLs to pure \n format otherwise all processing on ino file will likely fail solves #114 --- src/arduino.cc/builder/prototypes_adder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arduino.cc/builder/prototypes_adder.go b/src/arduino.cc/builder/prototypes_adder.go index ef2be7c2..fb1d392c 100644 --- a/src/arduino.cc/builder/prototypes_adder.go +++ b/src/arduino.cc/builder/prototypes_adder.go @@ -43,6 +43,10 @@ type PrototypesAdder struct{} func (s *PrototypesAdder) Run(context map[string]interface{}) error { debugOutput := context[constants.CTX_DEBUG_PREPROCESSOR] != nil source := context[constants.CTX_SOURCE].(string) + + source = strings.Replace(source, "\r\n", "\n", -1) + source = strings.Replace(source, "\r", "\n", -1) + sourceRows := strings.Split(source, "\n") if !utils.MapHas(context, constants.CTX_LINE_WHERE_TO_INSERT_PROTOTYPES) {