1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-26 10:36:03 +01:00

Bugfix: Do not drop further commands in same packet

This commit is contained in:
Harald Barth 2025-02-24 23:57:56 +01:00
parent d9bd1e75f2
commit 393b0bbd16

View File

@ -270,15 +270,19 @@ void DCCEXParser::parse(Print *stream, byte *com, RingStream *ringStream) {
// This function can get stings of the form "<C OMM AND>" or "C OMM AND>" // This function can get stings of the form "<C OMM AND>" or "C OMM AND>"
// found is true first after the leading "<" has been passed which results // found is true first after the leading "<" has been passed which results
// in parseOne() getting c="C OMM AND>" // in parseOne() getting c="C OMM AND>"
byte *cForLater = NULL;
bool found = (com[0] != '<'); bool found = (com[0] != '<');
for (byte *c=com; c[0] != '\0'; c++) { for (byte *c=com; c[0] != '\0'; c++) {
if (found) { if (found) {
parseOne(stream, c, ringStream); cForLater = c;
found=false; found=false;
} }
if (c[0] == '<') if (c[0] == '<') {
if (cForLater) parseOne(stream, cForLater, ringStream);
found = true; found = true;
} }
}
if (cForLater) parseOne(stream, cForLater, ringStream);
} }
void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)