diff options
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir/avl.c')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/avl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/avl.c b/Build/source/texk/web2c/pdftexdir/avl.c index 0241ebd3e6b..0c322f12071 100644 --- a/Build/source/texk/web2c/pdftexdir/avl.c +++ b/Build/source/texk/web2c/pdftexdir/avl.c @@ -658,8 +658,7 @@ struct avl_table *avl_copy(const struct avl_table *org, avl_copy_func * copy, int height = 0; struct avl_table *new; - const struct avl_node *x; - struct avl_node *y; + struct avl_node org_head, *x, *y; assert(org != NULL); new = avl_create(org->avl_compare, org->avl_param, @@ -670,7 +669,8 @@ struct avl_table *avl_copy(const struct avl_table *org, avl_copy_func * copy, if (new->avl_count == 0) return new; - x = (const struct avl_node *) &org->avl_root; + org_head.avl_link[0] = (struct avl_node *) org->avl_root; + x = &org_head; y = (struct avl_node *) &new->avl_root; for (;;) { while (x->avl_link[0] != NULL) { @@ -689,7 +689,7 @@ struct avl_table *avl_copy(const struct avl_table *org, avl_copy_func * copy, return NULL; } - stack[height++] = (struct avl_node *) x; + stack[height++] = x; stack[height++] = y; x = x->avl_link[0]; y = y->avl_link[0]; |