fix(radio): Fix handling of blank lines in YAML files (#3762)
* Fix handling of blank lines in YAML files. * Added some basic EOL / blank line unit tests --------- Co-authored-by: raphaelcoeffic <raphael.coeffic@frafos.com>
This commit is contained in:
co-authored by
raphaelcoeffic
parent
fec64a964d
commit
65ee80f159
@@ -302,15 +302,13 @@ YamlParser::parse(const char* buffer, unsigned int size)
|
||||
break;
|
||||
|
||||
case ps_CRLF:
|
||||
if (*c == '\n') {
|
||||
// Skip blank lines
|
||||
while (c < end && (*c == '\r' || *c == '\n'))
|
||||
c += 1;
|
||||
// reset state at EOL
|
||||
// Skip blank lines
|
||||
while (c < end && (*c == '\r' || *c == '\n'))
|
||||
c += 1;
|
||||
// reset state at EOL (unless we have run out of buffer, in case EOL continues in next buffer)
|
||||
if (c < end)
|
||||
reset();
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
c++;
|
||||
|
||||
Reference in New Issue
Block a user