summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tab.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tab.c b/src/tab.c
index 8e6bf0d..22fdc3e 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -74,11 +74,12 @@ append_child(MqTab *new_node, MqTab *parent)
new_node->next = NULL;
new_node->prev = parent->last_child; /* May be NULL */
new_node->first_child = new_node->last_child = NULL;
- new_node->position = parent->position; /* Will be updated */
new_node->tree_size = 0; /* Will be updated */
if (parent->last_child) {
+ new_node->position = parent->last_child->position;
parent->last_child->next = new_node;
} else {
+ new_node->position = parent->position;
parent->first_child = new_node;
}
parent->last_child = new_node;