Modify datatest parse to eat whitespace when line continuation is in effect
Previously the parsed string would look as follows. You would get this on a failed self test.
Key: 0000000000000000
0000000000000000
0000000000000000
0000000000000000
The new behavior eats the leading whitespace, so the key is reported as:
Key: 0000000000000000000000000000000000000000000000000000000000000000
pull/416/head
parent
d236cf1277
commit
e456cd2275
11
datatest.cpp
11
datatest.cpp
|
|
@ -685,9 +685,20 @@ bool GetField(std::istream &is, std::string &name, std::string &value)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
continueLine = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
is.get(buffer, sizeof(buffer));
|
is.get(buffer, sizeof(buffer));
|
||||||
|
|
||||||
|
// Eat leading whispace on line continuation
|
||||||
|
if (continueLine == true)
|
||||||
|
{
|
||||||
|
size_t pos = 0;
|
||||||
|
while (buffer[pos] != '\0' && buffer[pos] != ' ')
|
||||||
|
pos++;
|
||||||
|
value += &buffer[pos];
|
||||||
|
}
|
||||||
|
else
|
||||||
value += buffer;
|
value += buffer;
|
||||||
if (buffer[0] == ' ')
|
if (buffer[0] == ' ')
|
||||||
space = true;
|
space = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue