]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: initialize cmd_vector and add a root node to graph
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 30 Sep 2016 19:33:11 +0000 (19:33 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 30 Sep 2016 19:33:11 +0000 (19:33 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command.c

index c98e2562db47a7d947dac23c04491e56f2fbbdc7..877edde9aaa8ffc44c67adbb9930cd31132fea1d 100644 (file)
@@ -206,6 +206,10 @@ install_node (struct cmd_node *node,
   vector_set_index (cmdvec, node->node, node);
   node->func = func;
   node->cmdgraph = graph_new ();
+  node->cmd_vector = vector_init (VECTOR_MIN_SIZE);
+  // add start node
+  struct cmd_token *token = new_cmd_token (START_TKN, NULL, NULL);
+  graph_new_node (node->cmdgraph, token, (void (*)(void *)) &del_cmd_token);
 }
 
 /* Breaking up string into each command piece. I assume given