Don't suppress default handler unnecessarily (Issue
The roles XML_ROLE_DOCTYPE_PUBLIC_ID and XML_ROLE_DOCTYPE_SYSTEM_ID
fall through to XML_ROLE_ENTITY_PUBLIC_ID and XML_ROLE_ENTITY_SYSTEM_ID
respectively.  This lead to the default handler getting suppressed if
there was no start doctype declaration handler but there was an entity
declaration handler.
@@ -4501,7 +4501,10 @@ doProlog(XML_Parser parser,
normalizePublicId(tem);
declEntity->publicId = tem;
poolFinish(&dtd->pool);
- if (entityDeclHandler)
+ /* Don't suppress the default handler if we fell through from
+ * the XML_ROLE_DOCTYPE_PUBLIC_ID case.
+ */
+ if (entityDeclHandler && role == XML_ROLE_ENTITY_PUBLIC_ID)
handleDefault = XML_FALSE;
}
break;
@@ -4805,7 +4808,10 @@ doProlog(XML_Parser parser,
return XML_ERROR_NO_MEMORY;
declEntity->base = curBase;
poolFinish(&dtd->pool);
- if (entityDeclHandler)
+ /* Don't suppress the default handler if we fell through from
+ * the XML_ROLE_DOCTYPE_SYSTEM_ID case.
+ */
+ if (entityDeclHandler && role == XML_ROLE_ENTITY_SYSTEM_ID)
handleDefault = XML_FALSE;
}
break;
