mirror of
https://github.com/mariiaan/minipp.git
synced 2026-05-14 10:11:17 +02:00
Fix bug where escape sequences in string arrays are not parsed correctly
This commit is contained in:
@@ -547,7 +547,16 @@ minipp::EResult minipp::MiniPPFile::Values::ArrayValue::Parse(const std::string&
|
||||
if (isInString)
|
||||
{
|
||||
if (c == '\\')
|
||||
{
|
||||
if (i + 1 >= str.size())
|
||||
{
|
||||
PP_COUT("Syntax error: Bad escape sequence: '\\' at end of string");
|
||||
return EResult::FormatError;
|
||||
}
|
||||
currentElement += c;
|
||||
currentElement += str[i + 1];
|
||||
++i;
|
||||
}
|
||||
else if (c == '"')
|
||||
{
|
||||
isInString = false;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
[game]
|
||||
name = "Test Game"
|
||||
name = "Test Game\nNext Line"
|
||||
version = "1.0.0"
|
||||
year = 2025
|
||||
completionPercentage = 50.0f
|
||||
# Should only be true if completionPercentage is 100
|
||||
is_completed = false
|
||||
testargs = ["this is a \"test\"", "this is\n the next line"]
|
||||
|
||||
# This section is about
|
||||
# the settings of a game window
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
[game]
|
||||
name = "Test Game"
|
||||
name = "Test Game\nNext Line"
|
||||
completionPercentage = 50.000000
|
||||
version = "1.0.0"
|
||||
testargs = ["this is a \"test\"", "this is\n the next line"]
|
||||
year = 2025
|
||||
# Should only be true if completionPercentage is 100
|
||||
is_completed = false
|
||||
|
||||
Reference in New Issue
Block a user