From 719cc091e94acbf4594f3070cd07101f57ce686f Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 24 Sep 2017 22:21:11 -0400 Subject: MqTab: Fix append_sibling() Wow. --- (limited to 'src') diff --git a/src/tab.c b/src/tab.c index 4dac405..93aae37 100644 --- a/src/tab.c +++ b/src/tab.c @@ -78,12 +78,10 @@ append_sibling(MqTab *new_node, MqTab *prev_sibling) new_node->first_child = new_node->last_child = NULL; new_node->position = prev_sibling->position; /* Will be updated */ new_node->tree_size = 0; /* Will be updated */ - if (parent->last_child) { - parent->last_child->next = new_node; - } else { - parent->first_child = new_node; + if (prev_sibling->next) { + prev_sibling->next->prev = new_node; } - parent->last_child = new_node; + prev_sibling->next = new_node; update_positions(new_node, 1); update_tree_sizes(new_node, 1); } -- cgit v0.9.1