[libxml2] Fix spurious error message



commit a07a4e96d04e802c291578a850a17797912249ab
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sat May 27 17:04:12 2017 +0200

    Fix spurious error message
    
    Commit c851970 introduced a spurious error message when evaluating
    XPath expressions with xmlXPathCompiledEvalToBoolean.

 xpath.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/xpath.c b/xpath.c
index ff44799..6f4da78 100644
--- a/xpath.c
+++ b/xpath.c
@@ -14971,8 +14971,9 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
     } else {
         resObj = valuePop(pctxt);
         if (resObj == NULL) {
-            xmlGenericError(xmlGenericErrorContext,
-                "xmlXPathCompiledEval: No result on the stack.\n");
+            if (!toBool)
+                xmlGenericError(xmlGenericErrorContext,
+                    "xmlXPathCompiledEval: No result on the stack.\n");
         } else if (pctxt->valueNr > 0) {
             xmlGenericError(xmlGenericErrorContext,
                 "xmlXPathCompiledEval: %d object(s) left on the stack.\n",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]