From 2afddbf2fbd917d03179d53ea602f22645182fa3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 26 May 2004 13:47:08 +0000 Subject: [PATCH] Bug fix: did not return root (absyn) node --- recctrl/danbibr.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/recctrl/danbibr.c b/recctrl/danbibr.c index 1235f87..6459d98 100644 --- a/recctrl/danbibr.c +++ b/recctrl/danbibr.c @@ -1,4 +1,4 @@ -/* $Id: danbibr.c,v 1.3 2004-05-26 13:26:17 adam Exp $ +/* $Id: danbibr.c,v 1.4 2004-05-26 13:47:08 adam Exp $ Copyright (C) 2004 Index Data Aps @@ -84,13 +84,12 @@ static int read_rec(struct grs_read_info *p) static data1_node *mk_tree(struct grs_read_info *p, const char *rec_buf) { data1_node *root = data1_mk_root(p->dh, p->mem, "danbib"); + data1_node *root_tag = data1_mk_tag(p->dh, p->mem, "danbib", 0, root); const char *cp = rec_buf; - root = data1_mk_tag(p->dh, p->mem, "danbib", 0, root); - if (1) /* all */ { - data1_node *text_node = data1_mk_tag(p->dh, p->mem, "text", 0, root); + data1_node *text_node = data1_mk_tag(p->dh, p->mem, "text", 0, root_tag); data1_mk_text_n(p->dh, p->mem, rec_buf, strlen(rec_buf), text_node); } while (*cp) @@ -121,7 +120,7 @@ static data1_node *mk_tree(struct grs_read_info *p, const char *rec_buf) data1_node *hnode; sprintf(elemstr, "head%d", no); - hnode = data1_mk_tag(p->dh, p->mem, elemstr, 0, root); + hnode = data1_mk_tag(p->dh, p->mem, elemstr, 0, root_tag); data1_mk_text_n(p->dh, p->mem, start_text, cp - start_text, hnode); start_text = cp+1; @@ -137,7 +136,7 @@ static data1_node *mk_tree(struct grs_read_info *p, const char *rec_buf) { data1_node *tag_node = data1_mk_tag_n(p->dh, p->mem, - start_tag, cp - start_tag, 0, root); + start_tag, cp - start_tag, 0, root_tag); cp++; start_text = cp; while (*cp != '\n' && *cp) -- 1.7.10.4