summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2017-11-10 07:50:27 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-11-10 07:50:27 (GMT)
commitb1258b6d6e9e0482b37e86977ffc779e14c75b9f (patch) (side-by-side diff)
treee84c46aaa6675fbd574013e50b854866df734ce6
parent6020d6243c7fdf657da768b3fb2efa1244665d51 (diff)
downloadgrecs-b1258b6d6e9e0482b37e86977ffc779e14c75b9f.tar.gz
grecs-b1258b6d6e9e0482b37e86977ffc779e14c75b9f.tar.bz2
Fix 5938aedc.
* src/tree.c (grecs_node_unlink): Partially revert 5938aedc. (node_merge_block): Fix prev link.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/tree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tree.c b/src/tree.c
index 307682c..e25c6a5 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -120,16 +120,17 @@ grecs_node_bind(struct grecs_node *master, struct grecs_node *node, int dn)
int
grecs_node_unlink(struct grecs_node *node)
{
- if (node->up && node->up->down == node)
- node->up->down = node->prev;
if (node->prev)
node->prev->next = node->next;
+ else if (node->up)
+ node->up->down = node->next;
+ else
+ return 1;
if (node->next)
node->next->prev = node->prev;
node->up = node->prev = node->next = NULL;
return 0;
}
-
static void
listel_dispose(void *el)
@@ -1089,7 +1090,10 @@ node_merge_block(struct grecs_node *to_node, struct grecs_node *from_node,
if (!sp->next)
break;
}
+
sp->next = to_node->down;
+ to_node->down->prev = sp;
+
to_node->down = from_node->down;
from_node->down = NULL;
}

Return to:

Send suggestions and report system problems to the System administrator.