Skip to content

Commit fabca8e

Browse files
committed
Fix ignored first @Pause
1 parent 147ccd8 commit fabca8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gpx/gpx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,7 +2982,7 @@ static int parse_macro(Gpx *gpx, const char* macro, char *p)
29822982
}
29832983
// ;@body
29842984
else if(MACRO_IS("body")) {
2985-
if(gpx->flag.pausePending) {
2985+
if(gpx->flag.pausePending && gpx->flag.runMacros) {
29862986
CALL( pause_at_zpos(gpx, gpx->commandAt[0].z) );
29872987
gpx->flag.pausePending = 0;
29882988
}
@@ -4244,7 +4244,7 @@ int gpx_convert_line(Gpx *gpx, char *gcode_line)
42444244
else {
42454245
// enable macros in object body
42464246
if(!gpx->flag.macrosEnabled && percent > 0) {
4247-
if(gpx->flag.pausePending) {
4247+
if(gpx->flag.pausePending && gpx->flag.runMacros) {
42484248
CALL( pause_at_zpos(gpx, gpx->commandAt[0].z) );
42494249
gpx->flag.pausePending = 0;
42504250
}
@@ -4959,6 +4959,7 @@ int gpx_convert(Gpx *gpx, FILE *file_in, FILE *file_out, FILE *file_out2)
49594959
gpx_initialize(gpx, 0);
49604960
gpx->flag.loadMacros = 0;
49614961
gpx->flag.runMacros = 1;
4962+
gpx->flag.pausePending = (gpx->commandAtLength > 0);
49624963
//gpx->flag.logMessages = 0;
49634964
gpx->callbackHandler = (int (*)(Gpx*, void*, char*, size_t))file_handler;
49644965
gpx->callbackData = &file;

0 commit comments

Comments
 (0)