Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5254,13 +5254,17 @@ void process_next_command() {

// Sanitize the current command:
// - Skip leading spaces
// - Bypass N[0-9]+[ ]*
// - Overwrite * with nul to mark the end
while (*current_command == ' ') ++current_command;
// - Bypass N[0-9]+[ ]*
if (*current_command == 'N' && current_command[1] >= '0' && current_command[1] <= '9') {
// Skip the N[0-9] that we just found
current_command += 2; // alternately ++current_command; ++current_command;
// [0-9]*
while (*current_command >= '0' && *current_command <= '9') ++current_command;
// - Bypass [ ]*
while (*current_command == ' ') ++current_command;
}
// - Overwrite * with nul to mark the end
char *starpos = strchr(current_command, '*'); // * should always be the last parameter
if (starpos) *starpos = '\0';

Expand Down