- Fix tree head/tail upon insertion
This commit is contained in:
parent
880cd6f1a9
commit
4f68e5b613
1 changed files with 9 additions and 1 deletions
10
lib/rbl.c
10
lib/rbl.c
|
@ -17,7 +17,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id: rbl.c,v 1.1.2.3 2000/11/18 23:21:00 guus Exp $
|
||||
$Id: rbl.c,v 1.1.2.4 2000/11/18 23:22:44 guus Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -190,6 +190,14 @@ rbl_t rbl_insert_rbl(rbltree_t *tree, rbl_t *rbl)
|
|||
else
|
||||
tree->top = rbl;
|
||||
|
||||
/* Linked list fixup */
|
||||
|
||||
if(!rbl->prev)
|
||||
tree->head = rbl;
|
||||
|
||||
if(!rbl->next)
|
||||
tree->tail = rbl;
|
||||
|
||||
/* Red-black part of insert */
|
||||
|
||||
rbl->color = RBL_RED;
|
||||
|
|
Loading…
Reference in a new issue