print single space for "arbitrary whitespace" and nothing for "skip"
This commit is contained in:
@ -699,6 +699,10 @@ formatOutput()
|
|||||||
fieldAddress.clear();
|
fieldAddress.clear();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case StreamProtocolParser::whitespace:
|
||||||
|
outputLine.append(' ');
|
||||||
|
case StreamProtocolParser::skip:
|
||||||
|
continue;
|
||||||
case esc:
|
case esc:
|
||||||
// escaped literal byte
|
// escaped literal byte
|
||||||
command = *commandIndex++;
|
command = *commandIndex++;
|
||||||
@ -722,10 +726,19 @@ printSeparator()
|
|||||||
long i = 0;
|
long i = 0;
|
||||||
for (; i < separator.length(); i++)
|
for (; i < separator.length(); i++)
|
||||||
{
|
{
|
||||||
if (separator[i] == StreamProtocolParser::skip ||
|
switch (separator[i])
|
||||||
separator[i] == StreamProtocolParser::whitespace) continue; // wildcards
|
{
|
||||||
if (separator[i] == esc) i++; // escaped literal byte
|
case StreamProtocolParser::whitespace:
|
||||||
outputLine.append(separator[i]);
|
outputLine.append(' '); // print single space
|
||||||
|
case StreamProtocolParser::skip:
|
||||||
|
continue;
|
||||||
|
case esc:
|
||||||
|
// escaped literal byte
|
||||||
|
i++;
|
||||||
|
default:
|
||||||
|
// literal byte
|
||||||
|
outputLine.append(separator[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user