summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-24 22:21:11 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-24 22:21:11 (EDT)
commit719cc091e94acbf4594f3070cd07101f57ce686f (patch)
tree74481f0de9e6c35b6d77d7a62d87d71796222922 /src
parent14b4d10e687624076edabf1a908545471157ac9d (diff)
downloadmarquee-719cc091e94acbf4594f3070cd07101f57ce686f.zip
marquee-719cc091e94acbf4594f3070cd07101f57ce686f.tar.gz
marquee-719cc091e94acbf4594f3070cd07101f57ce686f.tar.bz2
MqTab: Fix append_sibling()
Wow.
Diffstat (limited to 'src')
-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);
}