1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

applied patch from Richard Jinks for the namespace axis + fixed a memory

* xpath.c: applied patch from Richard Jinks for the namespace
  axis + fixed a memory error.
* parser.c parserInternals.c: applied patches from Peter Jacobi
  removing ctxt->token for good.
* xmlschemas.c xmlschemastypes.c: fixed a few memory leaks
  popped out by the regression tests.
* Makefile.am: patch for threads makefile from Gary Pennington
Daniel
This commit is contained in:
Daniel Veillard
2002-07-01 21:52:03 +00:00
parent 692092b588
commit fdc9156a75
10 changed files with 216 additions and 393 deletions

31
xpath.c
View File

@ -4873,7 +4873,7 @@ xmlXPathDivValues(xmlXPathParserContextPtr ctxt) {
void
xmlXPathModValues(xmlXPathParserContextPtr ctxt) {
xmlXPathObjectPtr arg;
double arg1, arg2, tmp;
double arg1, arg2;
arg = valuePop(ctxt);
if (arg == NULL)
@ -4887,8 +4887,7 @@ xmlXPathModValues(xmlXPathParserContextPtr ctxt) {
if (arg2 == 0)
ctxt->value->floatval = xmlXPathNAN;
else {
tmp=arg1/arg2;
ctxt->value->floatval = arg2 * (tmp - (double)((int)tmp));
ctxt->value->floatval = fmod(arg1, arg2);
}
}
@ -5443,26 +5442,28 @@ xmlXPathNextPrecedingInternal(xmlXPathParserContextPtr ctxt,
*/
xmlNodePtr
xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
xmlNodePtr ret;
if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
if (cur == (xmlNodePtr) xmlXPathXMLNamespace)
return(NULL);
if ((cur == NULL) || (ctxt->context->tmpNsList == NULL)) {
if (ctxt->context->tmpNsList == NULL && cur != (xmlNodePtr) xmlXPathXMLNamespace) {
if (ctxt->context->tmpNsList != NULL)
xmlFree(ctxt->context->tmpNsList);
ctxt->context->tmpNsList =
xmlGetNsList(ctxt->context->doc, ctxt->context->node);
if (ctxt->context->tmpNsList == NULL) return(NULL);
ctxt->context->tmpNsNr = 0;
}
ret = (xmlNodePtr)ctxt->context->tmpNsList[ctxt->context->tmpNsNr++];
if (ret == NULL) {
xmlFree(ctxt->context->tmpNsList);
ctxt->context->tmpNsList = NULL;
if (ctxt->context->tmpNsList != NULL) {
while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
ctxt->context->tmpNsNr++;
}
}
return((xmlNodePtr) xmlXPathXMLNamespace);
}
return(ret);
if (ctxt->context->tmpNsNr > 0) {
return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
} else {
if (ctxt->context->tmpNsList != NULL)
xmlFree(ctxt->context->tmpNsList);
ctxt->context->tmpNsList = NULL;
return(NULL);
}
}
/**