sdc: Fix EOF handling during string parse

Fixes #1490

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2025-06-25 11:58:11 +02:00
parent f74aee7047
commit ff695f26d5
1 changed files with 6 additions and 2 deletions

View File

@ -186,8 +186,12 @@ struct SDCParser
s += c;
while (true) {
if (eof())
log_error("EOF while parsing string '%s'\n", s.c_str());
if (eof()) {
if (in_quotes || in_braces || escaped)
log_error("EOF while parsing string '%s'\n", s.c_str());
else
break;
}
char c = peek();
if (!in_quotes && !in_braces && !escaped && (std::isblank(c) || c == ']')) {