diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-30 19:33:11 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-30 19:33:11 +0000 |
| commit | 76b6abb95a1b4df23952d6cc20f9c4fc958323a4 (patch) | |
| tree | ba60f732c6284beeeed38240b2745f34e96a1adc /lib/command.c | |
| parent | bfbc035bd033774586cddbd9a69f571964999c9c (diff) | |
lib: initialize cmd_vector and add a root node to graph
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c index c98e2562db..877edde9aa 100644 --- a/lib/command.c +++ b/lib/command.c @@ -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 |
