(char *)(entity->textPtr + entity->textLen),
0);
entity->open = 0;
- if (result) {
- *eventPP = s;
+ if (result)
return result;
- }
}
else if (externalEntityRefHandler) {
const XML_Char *openEntityNames;
entity->open = 0;
if (!openEntityNames)
return XML_ERROR_NO_MEMORY;
- if (!externalEntityRefHandler(parser, openEntityNames, dtd.base, entity->systemId, entity->publicId)) {
- *eventPP = s;
+ if (!externalEntityRefHandler(parser, openEntityNames, dtd.base, entity->systemId, entity->publicId))
return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
- }
}
}
break;
if (!attId)
return XML_ERROR_NO_MEMORY;
if ((attId->name)[-1]) {
- eventPtr = atts[i].name;
+ if (enc == encoding)
+ eventPtr = atts[i].name;
return XML_ERROR_DUPLICATE_ATTRIBUTE;
}
(attId->name)[-1] = 1;
case XML_TOK_NONE:
return XML_ERROR_NONE;
case XML_TOK_INVALID:
- eventPtr = next;
+ if (enc == encoding)
+ eventPtr = next;
return XML_ERROR_INVALID_TOKEN;
case XML_TOK_PARTIAL:
- eventPtr = ptr;
+ if (enc == encoding)
+ eventPtr = ptr;
return XML_ERROR_INVALID_TOKEN;
case XML_TOK_CHAR_REF:
{
int i;
int n = XmlCharRefNumber(enc, ptr);
if (n < 0) {
- eventPtr = ptr;
+ if (enc == encoding)
+ eventPtr = ptr;
return XML_ERROR_BAD_CHAR_REF;
}
if (!isCdata
break;
n = XmlEncode(n, (ICHAR *)buf);
if (!n) {
- eventPtr = ptr;
+ if (enc == encoding)
+ eventPtr = ptr;
return XML_ERROR_BAD_CHAR_REF;
}
for (i = 0; i < n; i++) {
poolDiscard(&temp2Pool);
if (!entity) {
if (dtd.complete) {
- eventPtr = ptr;
+ if (enc == encoding)
+ eventPtr = ptr;
return XML_ERROR_UNDEFINED_ENTITY;
}
}
else if (entity->open) {
- eventPtr = ptr;
+ if (enc == encoding)
+ eventPtr = ptr;
return XML_ERROR_RECURSIVE_ENTITY_REF;
}
else if (entity->notation) {
- eventPtr = ptr;
+ if (enc == encoding)
+ eventPtr = ptr;
return XML_ERROR_BINARY_ENTITY_REF;
}
else if (!entity->textPtr) {
- eventPtr = ptr;
+ if (enc == encoding)
+ eventPtr = ptr;
return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF;
}
else {
entity->open = 1;
result = appendAttributeValue(parser, internalEnc, isCdata, (char *)entity->textPtr, (char *)textEnd, pool);
entity->open = 0;
- if (result) {
- eventPtr = ptr;
+ if (result)
return result;
- }
}
}
break;