diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-09 16:56:20 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-09 16:56:20 -0800 |
commit | 646112e4e6e4d4ab36c61cba47e71c0a58322637 (patch) | |
tree | 48609671afccc5021a97206b8744950ee174ada3 /src/cli_new.c | |
parent | 909d3e2eb34283300016f0671b213d2d756111cf (diff) | |
download | vyatta-cfg-646112e4e6e4d4ab36c61cba47e71c0a58322637.tar.gz vyatta-cfg-646112e4e6e4d4ab36c61cba47e71c0a58322637.zip |
* fix for bug 2472: return empty string when directory references don't
exist (for existence checks in templates).
* add debug output.
Diffstat (limited to 'src/cli_new.c')
-rw-r--r-- | src/cli_new.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cli_new.c b/src/cli_new.c index 97af812..a998b91 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -680,6 +680,8 @@ boolean val_cmp(valstruct *left, valstruct *right, vtw_cond_e cond) else rstop = 1; + DPRINT("val_cmp: type=%d count=(%d,%d) val=(%s,%s)\n", + val_type, lstop, rstop, left->val, right->val); for(lcur = 0; lcur < lstop; ++lcur) { if (!lcur && !left->cnt) lval = left->val; @@ -774,9 +776,13 @@ static boolean check_comp(vtw_node *cur) memset(&right, 0 , sizeof(right)); ret = FALSE; /* in case of status */ status = eval_va(&left, cur->vtw_node_left); + DPRINT("check_comp left status=%d type=%d cnt=%d val=[%s]\n", + status, left.val_type, left.cnt, left.val); if (status) goto free_and_return; status = eval_va(&right, cur->vtw_node_right); + DPRINT("check_comp right status=%d type=%d cnt=%d val=[%s]\n", + status, right.val_type, right.cnt, right.val); if (status) goto free_and_return; if(left.val_type != right.val_type) { @@ -1092,6 +1098,7 @@ static int eval_va(valstruct *res, vtw_node *node) clind_path_ref n_cmd_path=NULL; pathp = node->vtw_node_string; + DPRINT("eval_va var[%s]\n", pathp); assert(pathp[0]=='$' && pathp[1]=='('); pathp += 2; @@ -1117,7 +1124,6 @@ static int eval_va(valstruct *res, vtw_node *node) &n_tmpl_path, &n_cmd_path, is_in_delete_action())==0) { - clind_val cv; memset(&cv,0,sizeof(cv)); @@ -1150,6 +1156,7 @@ static int eval_va(valstruct *res, vtw_node *node) } case VAL_OP: + DPRINT("eval_va val[%s]\n", res->val); *res = node->vtw_node_val; res->free_me = FALSE; return 0; |