mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
A few serious bugfixes:
- parser.[ch] parserInternals.c: applied the conditional section processing fix from Jonathan P Springer <jonathan.springer2@gte.net> - xmlversion.h.in win32/libxml2/libxml2.dsp : Updated MS project file, fixed iconv default non support - xpath.c: fixed the problem of evaluating relative expressions when a node context is provided. Daniel
This commit is contained in:
9
xpath.c
9
xpath.c
@ -5520,7 +5520,7 @@ xmlXPathEvalLocationPath(xmlXPathParserContextPtr ctxt) {
|
||||
xmlXPathObjectPtr
|
||||
xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
|
||||
xmlXPathParserContextPtr ctxt;
|
||||
xmlXPathObjectPtr res = NULL, tmp;
|
||||
xmlXPathObjectPtr res = NULL, tmp, init = NULL;
|
||||
int stack = 0;
|
||||
|
||||
xmlXPathInit();
|
||||
@ -5528,6 +5528,10 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
|
||||
CHECK_CONTEXT(ctx)
|
||||
|
||||
ctxt = xmlXPathNewParserContext(str, ctx);
|
||||
if (ctx->node != NULL) {
|
||||
init = xmlXPathNewNodeSet(ctx->node);
|
||||
valuePush(ctxt, init);
|
||||
}
|
||||
xmlXPathEvalExpr(ctxt);
|
||||
|
||||
if (ctxt->value == NULL) {
|
||||
@ -5540,8 +5544,9 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
|
||||
do {
|
||||
tmp = valuePop(ctxt);
|
||||
if (tmp != NULL) {
|
||||
if (tmp != init)
|
||||
stack++;
|
||||
xmlXPathFreeObject(tmp);
|
||||
stack++;
|
||||
}
|
||||
} while (tmp != NULL);
|
||||
if (stack != 0) {
|
||||
|
Reference in New Issue
Block a user