Omit CVS Id. Update copyright year.
[idzebra-moved-to-github.git] / index / marcread.c
index 24f8e46..52b59e8 100644 (file)
@@ -1,8 +1,5 @@
-/* $Id: marcread.c,v 1.7 2007-03-08 13:18:35 adam Exp $
-   Copyright (C) 1995-2007
-   Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+   Copyright (C) 1995-2008 Index Data
 
 Zebra is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -772,14 +769,15 @@ static void parse_data1_tree(struct grs_read_info *p, const char *mc_stmnt,
 
                field = cat_field(p, pf, buf, field);
                
-               pb = wrbuf_buf(buf);
+               wrbuf_cstr(buf);
+                pb = wrbuf_buf(buf);
                for (pb = strtok(pb, "\n"); pb; pb = strtok(NULL, "\n"))
                {
-                       if (!is_empty(pb))
-                       {
-                               new = data1_mk_tag_n(p->dh, p->mem, mc_stmnt, strlen(mc_stmnt), 0, top);
-                               data1_mk_text_n(p->dh, p->mem, pb, strlen(pb), new);
-                       }
+                    if (!is_empty(pb))
+                    {
+                        new = data1_mk_tag_n(p->dh, p->mem, mc_stmnt, strlen(mc_stmnt), 0, top);
+                        data1_mk_text_n(p->dh, p->mem, pb, strlen(pb), new);
+                    }
                }
            }
            else
@@ -790,7 +788,7 @@ static void parse_data1_tree(struct grs_read_info *p, const char *mc_stmnt,
     }
     mc_destroy_field(pf);
     mc_destroy_context(c);
-    wrbuf_free(buf, 1);
+    wrbuf_destroy(buf);
 }
 
 data1_node *grs_read_marcxml(struct grs_read_info *p)