* Fixed: Yang patterns: \n and other non-printable characters were broken

* Example: Clixon interpereted them two characters: `\\ n` instead of ascii 10
This commit is contained in:
Olof hagsand 2021-08-05 09:59:20 +02:00
parent 603f9724ce
commit dcaeb581a1
5 changed files with 107 additions and 0 deletions

View file

@ -1896,6 +1896,18 @@ ys_parse_sub(yang_stmt *ys,
goto done;
}
break;
case Y_PATTERN:{
char *s0;
char *s1 = NULL;
/* Replace \\n with \n */
s0 = yang_argument_get(ys);
if (nonprint_encode(s0, &s1) < 0)
goto done;
yang_argument_set(ys, s1);
if (s0)
free(s0);
break;
}
case Y_UNKNOWN:{ /* save (optional) argument in ys_cv */
if (extra == NULL)
break;