summaryrefslogtreecommitdiff
path: root/lib/command_parse.y
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-09-07 23:02:39 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-09-07 23:02:39 +0000
commit97f13f08655c924e782e2aa82933b4a7eec68de2 (patch)
tree361548b82b146cfb730458dd9c357a36252edd0f /lib/command_parse.y
parent1eb5e8dcd17d84959a46a2d837ae719fc8eb3516 (diff)
lib: Fix deduplication bug, reinstate graph print
Comparing the wrong nodes led to duplication during graph construction, fixed. Also update graph pretty print to use new graph struct. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command_parse.y')
-rw-r--r--lib/command_parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/command_parse.y b/lib/command_parse.y
index 12f5a53212..9babfb76b0 100644
--- a/lib/command_parse.y
+++ b/lib/command_parse.y
@@ -469,7 +469,7 @@ node_adjacent (struct graph_node *first, struct graph_node *second)
for (unsigned int i = 0; i < vector_active (first->to); i++)
{
adj = vector_slot (first->to, i);
- struct cmd_token_t *ftok = first->data,
+ struct cmd_token_t *ftok = adj->data,
*stok = second->data;
if (cmp_token (ftok, stok))
return adj;
@@ -514,7 +514,7 @@ cmp_token (struct cmd_token_t *first, struct cmd_token_t *second)
if (first->text && second->text)
{
if (strcmp (first->text, second->text))
- return 0;
+ return 0;
}
else if (first->text != second->text) return 0;
break;