diff options
author | Aron Xu <aron@debian.org> | 2015-09-21 22:58:06 +0800 |
---|---|---|
committer | Aron Xu <aron@debian.org> | 2015-09-21 22:58:06 +0800 |
commit | 2ee13d9e464a1f5daccaff58f5d09d36b7c4f667 (patch) | |
tree | b022967f880b7fb1e56c8cc4c3f200d6ffbc9efd /encoding.c | |
parent | 7300193becde71a344c8ac0973dc290fa24d800d (diff) | |
download | libxml2-upstream.tar.gz |
Revert "Imported Upstream version 2.9.1+dfsg1"upstream
This reverts commit 7300193becde71a344c8ac0973dc290fa24d800d.
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -2384,6 +2384,7 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out, return (written? written : ret); } +#ifdef LIBXML_OUTPUT_ENABLED /** * xmlCharEncOutput: * @output: a parser output buffer @@ -2612,6 +2613,7 @@ retry: } return(ret); } +#endif /** * xmlCharEncOutFunc: @@ -2851,14 +2853,25 @@ int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { int ret = 0; int tofree = 0; + int i, handler_in_list = 0; + if (handler == NULL) return(-1); if (handler->name == NULL) return(-1); + if (handlers != NULL) { + for (i = 0;i < nbCharEncodingHandler; i++) { + if (handler == handlers[i]) { + handler_in_list = 1; + break; + } + } + } #ifdef LIBXML_ICONV_ENABLED /* * Iconv handlers can be used only once, free the whole block. * and the associated icon resources. */ - if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) { + if ((handler_in_list == 0) && + ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) { tofree = 1; if (handler->iconv_out != NULL) { if (iconv_close(handler->iconv_out)) @@ -2873,7 +2886,8 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { } #endif /* LIBXML_ICONV_ENABLED */ #ifdef LIBXML_ICU_ENABLED - if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) { + if ((handler_in_list == 0) && + ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) { tofree = 1; if (handler->uconv_out != NULL) { closeIcuConverter(handler->uconv_out); |