summaryrefslogtreecommitdiffstats
path: root/src/tab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tab.c')
-rw-r--r--src/tab.c8
1 files changed, 3 insertions, 5 deletions
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);
}