diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-24 22:21:11 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-24 22:21:11 (EDT) |
commit | 719cc091e94acbf4594f3070cd07101f57ce686f (patch) | |
tree | 74481f0de9e6c35b6d77d7a62d87d71796222922 | |
parent | 14b4d10e687624076edabf1a908545471157ac9d (diff) | |
download | marquee-719cc091e94acbf4594f3070cd07101f57ce686f.zip marquee-719cc091e94acbf4594f3070cd07101f57ce686f.tar.gz marquee-719cc091e94acbf4594f3070cd07101f57ce686f.tar.bz2 |
MqTab: Fix append_sibling()
Wow.
-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); } |