diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-06-26 23:18:33 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-06 13:37:44 -0700 |
commit | c3b23a060d2c949580873dc100469be9ad05734c (patch) | |
tree | e2af7f9bb2bfa6e5c5fefbf17d7edd99dad55939 /src/commit2.c | |
parent | 8f040d65de91b2d4ff08764d9408a21b5c145735 (diff) | |
download | vyatta-cfg-c3b23a060d2c949580873dc100469be9ad05734c.tar.gz vyatta-cfg-c3b23a060d2c949580873dc100469be9ad05734c.zip |
updated perl api for new cli to support working node representation. not yet functional without additional testing.
Diffstat (limited to 'src/commit2.c')
-rw-r--r-- | src/commit2.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/commit2.c b/src/commit2.c index daea436..5f70aa4 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -436,7 +436,13 @@ process_func(GNode *node, gpointer data) status = execute_list(c->_def.actions[result->_action].vtw_list_head,&c->_def); } else { - fprintf(out_stream,"%s\t:\t%s\n",ActionNames[result->_action],d->_path); + char buf[MAX_LENGTH_DIR_PATH*sizeof(char)]; + sprintf(buf,"%s\t:\t%s",ActionNames[result->_action],d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } + fprintf(out_stream,"%s\n",buf); status = 1; } if (result->_action == delete_act) { @@ -985,11 +991,19 @@ validate_func(GNode *node, gpointer data) char *buf = malloc(MAX_LENGTH_DIR_PATH*sizeof(char)); if (IS_DELETE(d->_operation)) { sprintf(buf,"- %s",d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } coll = g_slist_append(coll,buf); result->_data = (void*)&coll; } else if (IS_SET_OR_CREATE(d->_operation)) { sprintf(buf,"+ %s",d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } coll = g_slist_append(coll,buf); result->_data = (void*)&coll; } @@ -1052,7 +1066,13 @@ validate_func(GNode *node, gpointer data) status = execute_list(c->_def.actions[result->_action].vtw_list_head,&c->_def); } else { - fprintf(out_stream,"%s\t:\t%s\n",ActionNames[result->_action],d->_path); + char buf[MAX_LENGTH_DIR_PATH*sizeof(char)]; + sprintf(buf,"%s\t:\t%s",ActionNames[result->_action],d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } + fprintf(out_stream,"%s\n",buf); status = 1; } |