[LIBXML2] Update to version 2.9.14. CORE-17766

This commit is contained in:
Thomas Faber 2022-11-19 15:10:55 -05:00
parent 7244e0c5c6
commit 8940614a78
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
16 changed files with 226 additions and 232 deletions

View file

@ -488,9 +488,9 @@ int wrap_cmp( xmlNodePtr x, xmlNodePtr y );
* *
************************************************************************/
double xmlXPathNAN;
double xmlXPathPINF;
double xmlXPathNINF;
double xmlXPathNAN = 0.0;
double xmlXPathPINF = 0.0;
double xmlXPathNINF = 0.0;
/**
* xmlXPathInit:
@ -9260,52 +9260,45 @@ xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs) {
*/
void
xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathObjectPtr obj = NULL;
xmlChar *source = NULL;
xmlBufPtr target;
xmlChar blank;
xmlChar *source, *target;
int blank;
if (ctxt == NULL) return;
if (nargs == 0) {
/* Use current context node */
valuePush(ctxt,
xmlXPathCacheWrapString(ctxt->context,
xmlXPathCastNodeToString(ctxt->context->node)));
nargs = 1;
}
if (ctxt == NULL) return;
if (nargs == 0) {
/* Use current context node */
valuePush(ctxt,
xmlXPathCacheWrapString(ctxt->context,
xmlXPathCastNodeToString(ctxt->context->node)));
nargs = 1;
}
CHECK_ARITY(1);
CAST_TO_STRING;
CHECK_TYPE(XPATH_STRING);
obj = valuePop(ctxt);
source = obj->stringval;
target = xmlBufCreate();
if (target && source) {
CHECK_ARITY(1);
CAST_TO_STRING;
CHECK_TYPE(XPATH_STRING);
source = ctxt->value->stringval;
if (source == NULL)
return;
target = source;
/* Skip leading whitespaces */
while (IS_BLANK_CH(*source))
source++;
source++;
/* Collapse intermediate whitespaces, and skip trailing whitespaces */
blank = 0;
while (*source) {
if (IS_BLANK_CH(*source)) {
blank = 0x20;
} else {
if (blank) {
xmlBufAdd(target, &blank, 1);
blank = 0;
}
xmlBufAdd(target, source, 1);
}
source++;
if (IS_BLANK_CH(*source)) {
blank = 1;
} else {
if (blank) {
*target++ = 0x20;
blank = 0;
}
*target++ = *source;
}
source++;
}
valuePush(ctxt, xmlXPathCacheNewString(ctxt->context,
xmlBufContent(target)));
xmlBufFree(target);
}
xmlXPathReleaseObject(ctxt->context, obj);
*target = 0;
}
/**