Call ys_populate_feature from if_feature_check

In some cases, the feature won't be populated yet, and therefore, we
will consider this feature as disabled.

Fixes #429
This commit is contained in:
Shmuel Hazan 2023-04-30 17:19:40 +03:00
parent 8732d118dd
commit b13917b2ac
6 changed files with 15 additions and 5 deletions

View file

@ -64,6 +64,7 @@
* @param[in] accept Sub-parse rule to accept
* @param[in] mainfile Name of main parse file
* @param[in] linenum Line number context in mainfile (assume parse module of ys)
* @param[in] h Clixon handle
* @param[out] enabled 0: Disabled, 1: Enabled (if present)
* @retval 0 OK
* @retval -1 Error
@ -74,7 +75,8 @@ yang_subparse(char *str,
enum yang_sub_parse_accept accept,
const char *mainfile,
int linenum,
int *enabled)
int *enabled,
clicon_handle h)
{
int retval = -1;
clixon_yang_sub_parse_yacc ife = {0,};
@ -86,6 +88,7 @@ yang_subparse(char *str,
ife.if_ys = ys; /* Used as trigger to check if enabled */
ife.if_accept = accept;
ife.if_mainfile = mainfile;
ife.h = h;
if (clixon_yang_sub_parsel_init(&ife) < 0)
goto done;
if (clixon_yang_sub_parseparse(&ife) != 0) { /* yacc returns 1 on error */