Allow empty strings if they are quoted. (#450)

Signed-off-by: Ralf Anton Beier <ralf_beier@me.com>
This commit is contained in:
Ralf Anton Beier 2019-05-24 17:57:47 +02:00 committed by Dirk Thomas
parent 9566f39d60
commit 5f0d331712
3 changed files with 32 additions and 1 deletions

View file

@ -849,7 +849,10 @@ static rcl_ret_t parse_value(
"Scalar value at line %d is bigger than %d bytes", line_num, MAX_STRING_SIZE);
return RCL_RET_ERROR;
} else {
if (0U == val_size) {
if (style != YAML_SINGLE_QUOTED_SCALAR_STYLE &&
style != YAML_DOUBLE_QUOTED_SCALAR_STYLE &&
0U == val_size)
{
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING("No value at line %d", line_num);
return RCL_RET_ERROR;
}