mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
parser: Pass global object to sax->setDocumentLocator
Revert part of commit c011e760. Fixes #732.
This commit is contained in:
parent
3b4a84e4b7
commit
039ce1e821
11
HTMLparser.c
11
HTMLparser.c
@ -4753,12 +4753,9 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
|
||||
if ((ctxt == NULL) || (ctxt->input == NULL))
|
||||
return(-1);
|
||||
|
||||
/*
|
||||
* Document locator is unused. Only for backward compatibility.
|
||||
*/
|
||||
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
|
||||
xmlSAXLocator copy = xmlDefaultSAXLocator;
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData, ©);
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData,
|
||||
(xmlSAXLocator *) &xmlDefaultSAXLocator);
|
||||
}
|
||||
|
||||
xmlDetectEncoding(ctxt);
|
||||
@ -5297,8 +5294,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
||||
avail = in->end - in->cur;
|
||||
}
|
||||
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
|
||||
xmlSAXLocator copy = xmlDefaultSAXLocator;
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData, ©);
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData,
|
||||
(xmlSAXLocator *) &xmlDefaultSAXLocator);
|
||||
}
|
||||
if ((ctxt->sax) && (ctxt->sax->startDocument) &&
|
||||
(!ctxt->disableSAX))
|
||||
|
18
parser.c
18
parser.c
@ -10496,12 +10496,9 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
|
||||
*/
|
||||
xmlCtxtInitializeLate(ctxt);
|
||||
|
||||
/*
|
||||
* Document locator is unused. Only for backward compatibility.
|
||||
*/
|
||||
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
|
||||
xmlSAXLocator copy = xmlDefaultSAXLocator;
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData, ©);
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData,
|
||||
(xmlSAXLocator *) &xmlDefaultSAXLocator);
|
||||
}
|
||||
|
||||
xmlDetectEncoding(ctxt);
|
||||
@ -10626,12 +10623,9 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) {
|
||||
|
||||
xmlCtxtInitializeLate(ctxt);
|
||||
|
||||
/*
|
||||
* Document locator is unused. Only for backward compatibility.
|
||||
*/
|
||||
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
|
||||
xmlSAXLocator copy = xmlDefaultSAXLocator;
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData, ©);
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData,
|
||||
(xmlSAXLocator *) &xmlDefaultSAXLocator);
|
||||
}
|
||||
|
||||
xmlDetectEncoding(ctxt);
|
||||
@ -11095,8 +11089,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
|
||||
}
|
||||
}
|
||||
if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
|
||||
xmlSAXLocator copy = xmlDefaultSAXLocator;
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData, ©);
|
||||
ctxt->sax->setDocumentLocator(ctxt->userData,
|
||||
(xmlSAXLocator *) &xmlDefaultSAXLocator);
|
||||
}
|
||||
if ((ctxt->sax) && (ctxt->sax->startDocument) &&
|
||||
(!ctxt->disableSAX))
|
||||
|
Loading…
x
Reference in New Issue
Block a user