YaML: escape exclamation marks to avoid issues with compliant parsers

and added some support for reading such escaped characters.
This commit is contained in:
Raphael Coeffic
2021-11-28 11:31:47 +10:00
committed by Peter Feerick
parent 1103a3c842
commit 66932626d5
4 changed files with 16 additions and 2 deletions
+13
View File
@@ -213,6 +213,10 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_ValQuo;
break;
}
if (*c == '\\') {
state = ps_ValEsc;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
break;
@@ -284,6 +288,15 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_ValQuo;
break;
}
if (*c == '\\') {
state = ps_ValEsc;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
break;
case ps_ValEsc:
state = ps_Val;
CONCAT_STR(scratch_buf, scratch_len, *c);
break;