From 393b0bbd168290c7c32b2e5d94d436495514bdf7 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 24 Feb 2025 23:57:56 +0100 Subject: [PATCH] Bugfix: Do not drop further commands in same packet --- DCCEXParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 6479bfe..6bec5fb 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -270,15 +270,19 @@ void DCCEXParser::parse(Print *stream, byte *com, RingStream *ringStream) { // This function can get stings of the form "" or "C OMM AND>" // found is true first after the leading "<" has been passed which results // in parseOne() getting c="C OMM AND>" + byte *cForLater = NULL; bool found = (com[0] != '<'); for (byte *c=com; c[0] != '\0'; c++) { if (found) { - parseOne(stream, c, ringStream); + cForLater = c; found=false; } - if (c[0] == '<') + if (c[0] == '<') { + if (cForLater) parseOne(stream, cForLater, ringStream); found = true; + } } + if (cForLater) parseOne(stream, cForLater, ringStream); } void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)