commit 06559b3add28c31d15ab6f91f524324df6f909aa Author: William M. Brack <wbrack@src.gnome.org> Date: Wed Mar 14 09:34:15 2007 +0000 fixed problem with referenced attribute groups (bug #417621) re-ordered * xmlschemas.c: fixed problem with referenced attribute groups (bug #417621) * configure.in: re-ordered some includes for types.h / socket.h (bug 416001) svn path=/trunk/; revision=3590 diff --git a/xmlschemas.c b/xmlschemas.c index 11e3eac..aec901a 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -19139,7 +19139,8 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, * Just remove the reference if the referenced group does not * contain any attribute uses. */ - if (gr->attrUses == NULL) { + sublist = ((xmlSchemaItemListPtr) gr->attrUses); + if ((sublist == NULL) || sublist->nbItems == 0) { if (xmlSchemaItemListRemove(list, i) == -1) return(-1); i--; @@ -19148,18 +19149,15 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt, /* * Add the attribute uses. */ - sublist = ((xmlSchemaItemListPtr) gr->attrUses); - if (sublist->nbItems != 0) { - list->items[i] = sublist->items[0]; - if (sublist->nbItems != 1) { - for (j = 1; j < sublist->nbItems; j++) { - i++; - if (xmlSchemaItemListInsert(list, - sublist->items[j], i) == -1) - return(-1); - } + list->items[i] = sublist->items[0]; + if (sublist->nbItems != 1) { + for (j = 1; j < sublist->nbItems; j++) { + i++; + if (xmlSchemaItemListInsert(list, + sublist->items[j], i) == -1) + return(-1); } - } + } } }