Skip to content

Commit 6a04210

Browse files
committed
Respect NGC_PARAMETERS_ENABLE
1 parent d480cca commit 6a04210

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

gcode.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,13 @@ char *gc_normalize_block (char *block, char **message)
595595
size_t len = s1 - comment - 4;
596596

597597
if(message && *message == NULL && !strncmp(comment, "(MSG,", 5) && (*message = malloc(len))) {
598+
comment += 5;
599+
#if NGC_PARAMETERS_ENABLE
600+
len = 0;
598601
float value;
599602
char *s3;
600603
uint_fast8_t char_counter = 0;
601604

602-
len = 0;
603-
comment += 5;
604-
605605
// Trim leading spaces
606606
while(*comment == ' ')
607607
comment++;
@@ -638,6 +638,13 @@ char *gc_normalize_block (char *block, char **message)
638638
}
639639
}
640640
}
641+
#else
642+
while(*comment == ' ') {
643+
comment++;
644+
len--;
645+
}
646+
memcpy(*message, comment, len);
647+
#endif
641648
}
642649

643650
#if NGC_EXPRESSIONS_ENABLE

0 commit comments

Comments
 (0)