Skip to content

Commit

Permalink
Merge pull request #124 from fgiudice98/master
Browse files Browse the repository at this point in the history
M23 fix
  • Loading branch information
davidramiro authored Dec 15, 2021
2 parents 7f023d9 + 96fcc5e commit 3600847
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7643,12 +7643,20 @@ inline void gcode_M17() {
* M23: Open a file
*/
inline void gcode_M23() {
byte filenameSlash = 0;
#if ENABLED(POWER_LOSS_RECOVERY)
card.removeJobRecoveryFile();
#endif
// Simplify3D includes the size, so zero out all spaces (#7227)
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
card.openFile(parser.string_arg, true);
for (char *fn = parser.string_arg; *fn; ++fn){
if (*fn == ' ') *fn = '\0';
if (*fn == '/') filenameSlash += 1;
}
if (filenameSlash > 1){
card.openFile(&parser.string_arg[1], true);
} else {
card.openFile(parser.string_arg, true);
}
}

/**
Expand Down

0 comments on commit 3600847

Please sign in to comment.