From: James Clark Date: Fri, 25 Jun 1999 14:47:34 +0000 (+0000) Subject: Fix bug with definition of attribute as #IMPLIED before definition with default X-Git-Tag: V19990626~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a9169214b822a2b194b48792b7a972f9aeecc2b;p=libexpat Fix bug with definition of attribute as #IMPLIED before definition with default --- diff --git a/expat/xmlparse/xmlparse.c b/expat/xmlparse/xmlparse.c index 847a168d..be29e2ed 100755 --- a/expat/xmlparse/xmlparse.c +++ b/expat/xmlparse/xmlparse.c @@ -2653,7 +2653,7 @@ enum XML_Error epilogProcessor(XML_Parser parser, int tok = XmlPrologTok(encoding, s, end, &next); eventEndPtr = next; switch (tok) { - case XML_TOK_TRAILING_CR: + case -XML_TOK_PROLOG_S: if (defaultHandler) { eventEndPtr = end; reportDefault(parser, encoding, s, end); @@ -3047,7 +3047,11 @@ reportDefault(XML_Parser parser, const ENCODING *enc, const char *s, const char static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, int isCdata, const XML_Char *value) { + int i; DEFAULT_ATTRIBUTE *att; + for (i = 0; i < type->nDefaultAtts; i++) + if (attId == type->defaultAtts[i].id) + return 1; if (type->nDefaultAtts == type->allocDefaultAtts) { if (type->allocDefaultAtts == 0) { type->allocDefaultAtts = 8;