X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=data1%2Fd1_utils.c;h=69db13f7506c7876a50c02b742284415447176ec;hp=cc6d8d68b7c446caf2c74206e9c81f13399cfe15;hb=20e2d608e0cd383054e627db00264388affb58cd;hpb=6a0f9234f945bc4956e2bcef75f715661a9eba9a diff --git a/data1/d1_utils.c b/data1/d1_utils.c index cc6d8d6..69db13f 100644 --- a/data1/d1_utils.c +++ b/data1/d1_utils.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) 1994-2011 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 @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -34,20 +37,20 @@ void data1_remove_node (data1_handle dh, data1_node *n) /* n is the only child */ if(! n->next){ - n->parent->last_child = 0; + n->parent->last_child = 0; } - } + } /* n is one of the following childrens */ else { data1_node * before; - + /* need to find sibling before me */ before = n->parent->child; while (before->next != n) before = before->next; - + before->next = n->next; - + /* n is last child of many */ if ( n->parent->last_child == n){ n->parent->last_child = before; @@ -71,16 +74,16 @@ void data1_remove_idzebra_subtree (data1_handle dh, data1_node *n) if (!strcmp(n->u.tag.tag, "idzebra")){ if (n->u.tag.attributes){ data1_xattr *xattr = n->u.tag.attributes; - + for (; xattr; xattr = xattr->next){ - if (!strcmp(xattr->name, "xmlns") - & !strcmp(xattr->value, + if (!strcmp(xattr->name, "xmlns") + & !strcmp(xattr->value, "http://www.indexdata.dk/zebra/")) data1_remove_node (dh, n); } } } - + break; /* case DATA1N_data: @@ -107,7 +110,7 @@ void data1_remove_idzebra_subtree (data1_handle dh, data1_node *n) n->parent->last_child, n); } */ - + }