mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-04 08:02:34 +03:00
xpath: Deprecate xmlXPathEvalExpr
Also check the argument instead of crashing if there's no context.
This commit is contained in:
@ -516,6 +516,7 @@ XMLPUBFUN void
|
|||||||
|
|
||||||
XMLPUBFUN void
|
XMLPUBFUN void
|
||||||
xmlXPathRoot (xmlXPathParserContextPtr ctxt);
|
xmlXPathRoot (xmlXPathParserContextPtr ctxt);
|
||||||
|
XML_DEPRECATED
|
||||||
XMLPUBFUN void
|
XMLPUBFUN void
|
||||||
xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
|
xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
|
||||||
XMLPUBFUN xmlChar *
|
XMLPUBFUN xmlChar *
|
||||||
|
@ -407,6 +407,7 @@ deprecated_funcs = {
|
|||||||
'xmlValidatePushElement': True,
|
'xmlValidatePushElement': True,
|
||||||
'xmlValidateRoot': True,
|
'xmlValidateRoot': True,
|
||||||
'xmlValidate': True,
|
'xmlValidate': True,
|
||||||
|
'xmlXPathEvalExpr': True,
|
||||||
'xmlXPathInit': True,
|
'xmlXPathInit': True,
|
||||||
'xmlXPtrEvalRangePredicate': True,
|
'xmlXPtrEvalRangePredicate': True,
|
||||||
'xmlXPtrNewCollapsedRange': True,
|
'xmlXPtrNewCollapsedRange': True,
|
||||||
|
4
xpath.c
4
xpath.c
@ -12531,6 +12531,8 @@ xmlXPathCompiledEvalToBoolean(xmlXPathCompExprPtr comp,
|
|||||||
* xmlXPathEvalExpr:
|
* xmlXPathEvalExpr:
|
||||||
* @ctxt: the XPath Parser context
|
* @ctxt: the XPath Parser context
|
||||||
*
|
*
|
||||||
|
* DEPRECATED: Internal function, don't use.
|
||||||
|
*
|
||||||
* Parse and evaluate an XPath expression in the given context,
|
* Parse and evaluate an XPath expression in the given context,
|
||||||
* then push the result on the context stack
|
* then push the result on the context stack
|
||||||
*/
|
*/
|
||||||
@ -12541,7 +12543,7 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
|
|||||||
#endif
|
#endif
|
||||||
int oldDepth = 0;
|
int oldDepth = 0;
|
||||||
|
|
||||||
if (ctxt == NULL)
|
if ((ctxt == NULL) || (ctxt->context == NULL))
|
||||||
return;
|
return;
|
||||||
if (ctxt->context->lastError.code != 0)
|
if (ctxt->context->lastError.code != 0)
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user