fixed permissive acceptance of incomplete CRLF at EOF (closes #132))

This commit is contained in:
Mark Gillard 2022-01-05 18:10:50 +02:00
parent 7d3770df92
commit 47241d003e
4 changed files with 8 additions and 3 deletions

View File

@ -36,7 +36,7 @@ code changes at callsites or in build systems are indicated with ⚠️.
- fixed parser not correctly round-tripping the format of binary and octal integers in some cases
- fixed strong exception guarantee edge-cases in `toml::table` and `toml::array`
- fixed some incorrect unicode scalar sequence transformations (#125)
- fixed a number of spec conformance issues (#127, #128, #129, #130, #131) (@moorereason)
- fixed a number of spec conformance issues (#127, #128, #129, #130, #131, #132) (@moorereason)
#### Additions:
- added `operator->` to `toml::value` for class types

View File

@ -1158,7 +1158,7 @@ TOML_IMPL_NAMESPACE_START
advance_and_return_if_error({}); // skip \r
if (is_eof())
return true; // eof after \r is 'fine'
set_error_and_return_default("expected \\n, saw EOF"sv);
if (*cp != U'\n')
set_error_and_return_default("expected \\n, saw '"sv, to_sv(*cp), "'"sv);

View File

@ -255,4 +255,9 @@ b = []
[a.b]
)"sv);
}
SECTION("github/issues/132") // https://github.com/marzer/tomlplusplus/issues/132
{
parsing_should_fail(FILE_LINE_ARGS, "#\r"sv);
}
}

View File

@ -11774,7 +11774,7 @@ TOML_IMPL_NAMESPACE_START
advance_and_return_if_error({}); // skip \r
if (is_eof())
return true; // eof after \r is 'fine'
set_error_and_return_default("expected \\n, saw EOF"sv);
if (*cp != U'\n')
set_error_and_return_default("expected \\n, saw '"sv, to_sv(*cp), "'"sv);