diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tab.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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); } |