X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=util%2Fattrfind.c;h=55a8a762324d7d4af4bf7a20adb8ea9e4a0c6dc1;hp=c1bacf119a738a53a3d0576fbc4f1260221c3876;hb=0dedb6a7a6a0f0ddaf56cb0673978fdd85e64be1;hpb=6a0f9234f945bc4956e2bcef75f715661a9eba9a diff --git a/util/attrfind.c b/util/attrfind.c index c1bacf1..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-2009 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; }