Skip to content

Commit

Permalink
Fix ignored first @Pause
Browse files Browse the repository at this point in the history
  • Loading branch information
markwal committed Jun 10, 2015
1 parent 147ccd8 commit fabca8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gpx/gpx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,7 @@ static int parse_macro(Gpx *gpx, const char* macro, char *p)
}
// ;@body
else if(MACRO_IS("body")) {
if(gpx->flag.pausePending) {
if(gpx->flag.pausePending && gpx->flag.runMacros) {
CALL( pause_at_zpos(gpx, gpx->commandAt[0].z) );
gpx->flag.pausePending = 0;
}
Expand Down Expand Up @@ -4244,7 +4244,7 @@ int gpx_convert_line(Gpx *gpx, char *gcode_line)
else {
// enable macros in object body
if(!gpx->flag.macrosEnabled && percent > 0) {
if(gpx->flag.pausePending) {
if(gpx->flag.pausePending && gpx->flag.runMacros) {
CALL( pause_at_zpos(gpx, gpx->commandAt[0].z) );
gpx->flag.pausePending = 0;
}
Expand Down Expand Up @@ -4959,6 +4959,7 @@ int gpx_convert(Gpx *gpx, FILE *file_in, FILE *file_out, FILE *file_out2)
gpx_initialize(gpx, 0);
gpx->flag.loadMacros = 0;
gpx->flag.runMacros = 1;
gpx->flag.pausePending = (gpx->commandAtLength > 0);
//gpx->flag.logMessages = 0;
gpx->callbackHandler = (int (*)(Gpx*, void*, char*, size_t))file_handler;
gpx->callbackData = &file;
Expand Down

1 comment on commit fabca8e

@dcnewman
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that will do the job without any unwanted side effects.

Please sign in to comment.