From a53c688b2e275cccfb13f46876aeae4a33fa4f5a Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 25 Jul 2001 17:18:57 +0000 Subject: 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 --- xpath.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xpath.c') 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; } -- cgit v1.2.1