fix bug raised by zamez on IRC regenerated, seems to pop-up leaks in new
* parserInternals.c: fix bug raised by zamez on IRC
* testapi.c: regenerated, seems to pop-up leaks in new tree functions
* tree.c: added comments missing.
* doc/*: regenerated
Daniel
diff --git a/parserInternals.c b/parserInternals.c
index 0e01deb..b5e302e 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -1267,9 +1267,11 @@
int
xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler)
{
+ int ret = 0;
+
if (handler != NULL) {
if (ctxt->input != NULL) {
- xmlSwitchInputEncoding(ctxt, ctxt->input, handler);
+ ret = xmlSwitchInputEncoding(ctxt, ctxt->input, handler);
} else {
xmlErrInternal(ctxt, "xmlSwitchToEncoding : no input\n",
NULL);
@@ -1281,7 +1283,7 @@
ctxt->charset = XML_CHAR_ENCODING_UTF8;
} else
return(-1);
- return(0);
+ return(ret);
}
/************************************************************************