mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 20:13:04 +00:00
[LIBXML2] Update to version 2.9.14. CORE-17766
This commit is contained in:
parent
7244e0c5c6
commit
8940614a78
16 changed files with 226 additions and 232 deletions
71
sdk/lib/3rdparty/libxml2/xpath.c
vendored
71
sdk/lib/3rdparty/libxml2/xpath.c
vendored
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue