From 9247ac5315621731adb2433d0ad002f426659e8b Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 25 Sep 2017 00:02:34 -0400 Subject: MqTab: Fix positions of appended children --- (limited to 'src') 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; -- cgit v0.9.1