X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=buffer_tree.c;h=cc2bb511696f2e65240a17bbc4962b20c9f0930b;hp=4bcc88abb9e56be5b5c29d7b9b9115ff84dfc009;hb=07fdaa7973c1b97ded3ebd200ef845728547f94e;hpb=37e0dfe7bf7737863c63e515e9ed06c2f479f5a3 diff --git a/buffer_tree.c b/buffer_tree.c index 4bcc88ab..cc2bb511 100644 --- a/buffer_tree.c +++ b/buffer_tree.c @@ -295,9 +295,10 @@ struct btr_node *btr_new_node(struct btr_node_description *bnd) bnd->child->parent = btrn; goto out; } - PARA_EMERG_LOG("inserting internal nodes not yet supported.\n"); - exit(EXIT_FAILURE); - assert(bnd->child->parent == bnd->parent); + list_add_tail(&btrn->node, &bnd->parent->children); + list_move(&bnd->child->node, &btrn->children); + bnd->child->parent = btrn; + PARA_INFO_LOG("added %s as internal node\n", bnd->name); out: return btrn; } @@ -385,7 +386,8 @@ void btr_add_output(char *buf, size_t size, struct btr_node *btrn) { struct btr_buffer *btrb; - assert(size != 0); + if (size == 0) + return; if (list_empty(&btrn->children)) { free(buf); return; @@ -414,7 +416,8 @@ void btr_add_output_dont_free(const char *buf, size_t size, struct btr_node *btr { struct btr_buffer *btrb; - assert(size != 0); + if (size == 0) + return; if (list_empty(&btrn->children)) return; btrb = new_btrb((char *)buf, size); @@ -441,7 +444,8 @@ void btr_add_output_pool(struct btr_pool *btrp, size_t size, char *buf; size_t avail; - assert(size != 0); + if (size == 0) + return; if (list_empty(&btrn->children)) return; avail = btr_pool_get_buffer(btrp, &buf);