Skip to content

Commit

Permalink
Do not enter macro state with macros disabled
Browse files Browse the repository at this point in the history
Issue: #290
  • Loading branch information
vstakhov committed Apr 20, 2024
1 parent 0820e70 commit bb92fa4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/ucl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,12 +1372,8 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk,

p = chunk->pos;

if (*p == '.') {
/* It is macro actually */
if (!(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
}

if (*p == '.' && !(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
parser->prev_state = parser->state;
parser->state = UCL_STATE_MACRO_NAME;
*end_of_object = false;
Expand Down Expand Up @@ -1415,7 +1411,7 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk,
*end_of_object = true;
return true;
}
else if (*p == '.') {
else if (*p == '.' && !(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
parser->prev_state = parser->state;
parser->state = UCL_STATE_MACRO_NAME;
Expand Down

0 comments on commit bb92fa4

Please sign in to comment.