X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=data1%2Fd1_utils.c;h=6484c50fb7220b0eb0f1ae5e525f8152b0f5e570;hb=585e87e5a6b274a8ee13b5432a462afd95c04096;hp=a794156295389a93045b09efd81d131681d059a8;hpb=4478d785b7769691261005c98063b98a5a5971b3;p=idzebra-moved-to-github.git diff --git a/data1/d1_utils.c b/data1/d1_utils.c index a794156..6484c50 100644 --- a/data1/d1_utils.c +++ b/data1/d1_utils.c @@ -1,8 +1,5 @@ -/* $Id: d1_utils.c,v 1.2 2006-08-14 10:40:06 adam Exp $ - Copyright (C) 1995-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 2004-2013 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 @@ -20,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -37,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; @@ -74,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: @@ -110,7 +110,7 @@ void data1_remove_idzebra_subtree (data1_handle dh, data1_node *n) n->parent->last_child, n); } */ - + } @@ -118,6 +118,7 @@ void data1_remove_idzebra_subtree (data1_handle dh, data1_node *n) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab