summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-07-25 17:18:57 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-07-25 17:18:57 +0000
commita53c688b2e275cccfb13f46876aeae4a33fa4f5a (patch)
treef62e0ec3979c9cc885b90f5be3e117608dc42b73 /xpath.c
parentd9bad13bb2d5894eb03f0cd36d26fffa81dd6f47 (diff)
downloadlibxml2-a53c688b2e275cccfb13f46876aeae4a33fa4f5a.tar.gz
fixed the xmlLineNumbersDefault() errors, lesson don't add new functions
* parser.c parserInternals.c: fixed the xmlLineNumbersDefault() errors, lesson don't add new functions at 1am before a release * xpath.c: integrated fix from Bjorn to avoid divide by zero from XPath initialization when possible. Daniel
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xpath.c b/xpath.c
index 73143b20..fc661f89 100644
--- a/xpath.c
+++ b/xpath.c
@@ -194,9 +194,16 @@ xmlXPathInit(void) {
if (initialized) return;
+#if defined(HUGE_VAL) && defined(DBL_MAX)
+ xmlXPathPINF = (HUGE_VAL == DBL_MAX) ?
+ xmlXPathDivideBy(1.0, 0.0) : HUGE_VAL;
+ xmlXPathNINF = -xmlXPathPINF;
+ xmlXPathNAN = xmlXPathDivideBy(xmlXPathPINF, xmlXPathPINF);
+#else
xmlXPathNAN = xmlXPathDivideBy(0.0, 0.0);
xmlXPathPINF = xmlXPathDivideBy(1.0, 0.0);
xmlXPathNINF = xmlXPathDivideBy(-1.0, 0.0);
+#endif
initialized = 1;
}