commit | 438f378a9b9b1edaf9f2ad19ad4183eafa693579 | [log] [tgz] |
---|---|---|
author | Michal Vasko <mvasko@cesnet.cz> | Wed Aug 09 10:01:15 2023 +0200 |
committer | Michal Vasko <mvasko@cesnet.cz> | Wed Aug 09 10:01:15 2023 +0200 |
tree | b76fdc50dc23881eb9e89b8629d69eb26712f488 | |
parent | 2ec0d8fcd3dcebb6925f2babc3f60316fd16adf6 [diff] |
parser yang BUGFIX encoded newline Fixes #2076
diff --git a/src/parser_yang.c b/src/parser_yang.c index b81cf60..03131da 100644 --- a/src/parser_yang.c +++ b/src/parser_yang.c
@@ -416,7 +416,8 @@ } break; case '\r': - if (ctx->in->current[1] != '\n') { + /* newline may be escaped */ + if ((ctx->in->current[1] != '\n') && strncmp(&ctx->in->current[1], "\\n", 2)) { LOGVAL_PARSER(ctx, LY_VCODE_INCHAR, ctx->in->current[0]); return LY_EVALID; }