Update copyright year + FSF address
[idzebra-moved-to-github.git] / index / recgrs.c
index 7adf160..e3ce3f7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: recgrs.c,v 1.1 2006-07-03 14:27:09 adam Exp $
+/* $Id: recgrs.c,v 1.4 2006-08-14 10:40:15 adam Exp $
    Copyright (C) 1995-2006
    Index Data ApS
 
@@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
 */
 
 #include <stdio.h>
@@ -937,6 +937,8 @@ int grs_extract_tree(struct recExtractCtrl *p, data1_node *n)
     }
     (*p->init)(p, &wrd);
 
+    /* data1_pr_tree(p->dh, n, stdout); */ 
+
     return dumpkeys(n, p, &wrd);
 }
 
@@ -980,6 +982,9 @@ static int grs_extract_sub(void *clientData, struct recExtractCtrl *p,
     /* ensure our data1 tree is UTF-8 */
     data1_iconv (p->dh, mem, n, "UTF-8", data1_get_encoding(p->dh, n));
 
+
+    data1_remove_idzebra_subtree (p->dh, n);
+
 #if 0
     data1_pr_tree (p->dh, n, stdout);
 #endif
@@ -987,10 +992,8 @@ static int grs_extract_sub(void *clientData, struct recExtractCtrl *p,
     (*p->init)(p, &wrd);
     if (dumpkeys(n, p, &wrd) < 0)
     {
-       data1_free_tree(p->dh, n);
        return RECCTRL_EXTRACT_ERROR_GENERIC;
     }
-    data1_free_tree(p->dh, n);
     return RECCTRL_EXTRACT_OK;
 }
 
@@ -1166,6 +1169,8 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p,
     }
     data1_concat_text(p->dh, mem, node);
 
+    data1_remove_idzebra_subtree (p->dh, node);
+
 #if 0
     data1_pr_tree (p->dh, node, stdout);
 #endif
@@ -1313,9 +1318,6 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p,
                                       p->odr)) > 0)
     {
        p->diagnostic = res;
-       if (onode)
-           data1_free_tree(p->dh, onode);
-       data1_free_tree(p->dh, node);
        nmem_destroy(mem);
        return 0;
     }
@@ -1432,10 +1434,6 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p,
                p->rec_buf = new_buf;
        }
     }
-    if (node)
-       data1_free_tree(p->dh, node);
-    if (onode)
-       data1_free_tree(p->dh, onode);
     nmem_destroy(mem);
     return 0;
 }