Skip to content

Commit 419a1b2

Browse files
authored
Avoid adding extra newline in writeCode (#2323)
2 parents eb2e612 + cb97e69 commit 419a1b2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/gcodeExport.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,11 @@ void GCodeExport::switchExtruder(size_t new_extruder, const RetractionConfig& re
15281528

15291529
void GCodeExport::writeCode(const std::string& str)
15301530
{
1531-
*output_stream_ << str << new_line_;
1531+
*output_stream_ << str;
1532+
if (! str.ends_with('\n'))
1533+
{
1534+
*output_stream_ << new_line_;
1535+
}
15321536
}
15331537

15341538
void GCodeExport::writeCodeWithAbsoluteExtrusion(const std::string& str)

0 commit comments

Comments
 (0)