X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=util%2Fattrfind.c;h=55a8a762324d7d4af4bf7a20adb8ea9e4a0c6dc1;hp=6ddb525c5afdb0265b4c1362f2c1b6840a158f1e;hb=0dedb6a7a6a0f0ddaf56cb0673978fdd85e64be1;hpb=a66b7d79383ae700f3358731eecfe2aafed0e90d diff --git a/util/attrfind.c b/util/attrfind.c index 6ddb525..55a8a76 100644 --- a/util/attrfind.c +++ b/util/attrfind.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2010 Index Data + Copyright (C) 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 @@ -52,7 +55,7 @@ int attr_find_ex(AttrType *src, const Odr_oid **attribute_set_oid, element = src->attributeList[src->major]; if (src->type == *element->attributeType) { - switch (element->which) + switch (element->which) { case Z_AttributeValue_numeric: ++(src->major); @@ -65,20 +68,20 @@ int attr_find_ex(AttrType *src, const Odr_oid **attribute_set_oid, break; if (element->attributeSet && attribute_set_oid) *attribute_set_oid = element->attributeSet; - if (element->value.complex->list[src->minor]->which == + if (element->value.complex->list[src->minor]->which == Z_StringOrNumeric_numeric) { ++(src->minor); return *element->value.complex->list[src->minor-1]->u.numeric; } - else if (element->value.complex->list[src->minor]->which == + else if (element->value.complex->list[src->minor]->which == Z_StringOrNumeric_string) { if (!string_value) break; ++(src->minor); - *string_value = + *string_value = element->value.complex->list[src->minor-1]->u.string; return -2; }