From 76d01f90287a7d7fd99c75536a2887048bcd7993 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Tue, 6 Jan 2009 10:24:26 +0000 Subject: [PATCH] update libxml2 to 2.7.2 svn path=/trunk/; revision=38604 --- reactos/include/reactos/libs/libxml/xmlsave.h | 5 +- .../include/reactos/libs/libxml/xmlversion.h | 8 +- reactos/lib/3rdparty/libxml2/ChangeLog | 36 +++ reactos/lib/3rdparty/libxml2/HTMLparser.c | 32 +- reactos/lib/3rdparty/libxml2/NEWS | 11 + reactos/lib/3rdparty/libxml2/config.h.in | 3 + reactos/lib/3rdparty/libxml2/configure | 294 +++++++++++++++++- reactos/lib/3rdparty/libxml2/configure.in | 4 +- reactos/lib/3rdparty/libxml2/dict.c | 4 + reactos/lib/3rdparty/libxml2/libxml2.spec | 6 +- reactos/lib/3rdparty/libxml2/parser.c | 6 +- reactos/lib/3rdparty/libxml2/runxmlconf.c | 10 + reactos/lib/3rdparty/libxml2/xmlreader.c | 57 +++- reactos/lib/3rdparty/libxml2/xmlsave.c | 27 +- 14 files changed, 462 insertions(+), 41 deletions(-) diff --git a/reactos/include/reactos/libs/libxml/xmlsave.h b/reactos/include/reactos/libs/libxml/xmlsave.h index c71c71a0339..4201b4d13dc 100644 --- a/reactos/include/reactos/libs/libxml/xmlsave.h +++ b/reactos/include/reactos/libs/libxml/xmlsave.h @@ -30,7 +30,10 @@ typedef enum { XML_SAVE_FORMAT = 1<<0, /* format save output */ XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */ XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */ - XML_SAVE_NO_XHTML = 1<<3 /* disable XHTML1 specific rules */ + XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */ + XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */ + XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */ + XML_SAVE_AS_HTML = 1<<6 /* force HTML serialization on XML doc */ } xmlSaveOption; diff --git a/reactos/include/reactos/libs/libxml/xmlversion.h b/reactos/include/reactos/libs/libxml/xmlversion.h index 227a86092d1..6c5d3428407 100644 --- a/reactos/include/reactos/libs/libxml/xmlversion.h +++ b/reactos/include/reactos/libs/libxml/xmlversion.h @@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.7.1" +#define LIBXML_DOTTED_VERSION "2.7.2" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20701 +#define LIBXML_VERSION 20702 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20701" +#define LIBXML_VERSION_STRING "20702" /** * LIBXML_VERSION_EXTRA: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20701); +#define LIBXML_TEST_VERSION xmlCheckVersion(20702); #ifndef VMS #if 0 diff --git a/reactos/lib/3rdparty/libxml2/ChangeLog b/reactos/lib/3rdparty/libxml2/ChangeLog index 2ef2cc71a3b..a37871eba28 100644 --- a/reactos/lib/3rdparty/libxml2/ChangeLog +++ b/reactos/lib/3rdparty/libxml2/ChangeLog @@ -1,3 +1,39 @@ +Fri Oct 3 09:43:45 CEST 2008 Daniel Veillard + + * configure.in doc/* NEWS: preparing the release of 2.7.2 + * dict.c: fix the Solaris portability issue + * parser.c: additional cleanup on #554660 fix + * test/ent13 result/ent13* result/noent/ent13*: added the + example in the regression test suite. + * HTMLparser.c: handle leading BOM in htmlParseElement() + +Thu Oct 2 22:53:39 CEST 2008 Daniel Veillard + + * parser.c: fix a nasty bug introduced when cleaning up + entities processing in 2.7.x , fixes #554660 + +Thu Sep 25 18:04:20 CEST 2008 Daniel Veillard + + * HTMLparser.c: fix an HTML parsing error on large data sections + reported by Mike Day + * test/HTML/utf8bug.html result/HTML/utf8bug.html.err + result/HTML/utf8bug.html.sax result/HTML/utf8bug.html: add the + reproducer to the test suite + +Thu Sep 25 17:35:57 CEST 2008 Daniel Veillard + + * runxmlconf.c: fix compilation if XPath is not included + +Thu Sep 25 16:54:04 CEST 2008 Daniel Veillard + + * xmlreader.c: patch from Riccardo Scussat fixing custom error + handlers problems. + +Thu Sep 25 16:30:11 CEST 2008 Daniel Veillard + + * include/libxml/xmlsave.h xmlsave.c: new options to serialize + as XML/HTML/XHTML and restore old entry point behaviours + Mon Sep 1 16:49:05 CEST 2008 Daniel Veillard * doc/xml.html doc/news.html configure.in python/setup.py NEWS: diff --git a/reactos/lib/3rdparty/libxml2/HTMLparser.c b/reactos/lib/3rdparty/libxml2/HTMLparser.c index 57e64df0558..24b0fc0fdbc 100644 --- a/reactos/lib/3rdparty/libxml2/HTMLparser.c +++ b/reactos/lib/3rdparty/libxml2/HTMLparser.c @@ -2768,6 +2768,7 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 5]; int nbchar = 0; int cur, l; + int chunk = 0; SHRINK; cur = CUR_CHAR(l); @@ -2798,6 +2799,12 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) { nbchar = 0; } NEXTL(l); + chunk++; + if (chunk > HTML_PARSER_BUFFER_SIZE) { + chunk = 0; + SHRINK; + GROW; + } cur = CUR_CHAR(l); if (cur == 0) { SHRINK; @@ -4113,6 +4120,8 @@ htmlParseElement(htmlParserCtxtPtr ctxt) { int htmlParseDocument(htmlParserCtxtPtr ctxt) { + xmlChar start[4]; + xmlCharEncoding enc; xmlDtdPtr dtd; xmlInitParser(); @@ -4132,6 +4141,23 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); + if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) && + ((ctxt->input->end - ctxt->input->cur) >= 4)) { + /* + * Get the 4 first bytes and decode the charset + * if enc != XML_CHAR_ENCODING_NONE + * plug some encoding conversion routines. + */ + start[0] = RAW; + start[1] = NXT(1); + start[2] = NXT(2); + start[3] = NXT(3); + enc = xmlDetectCharEncoding(&start[0], 4); + if (enc != XML_CHAR_ENCODING_NONE) { + xmlSwitchEncoding(ctxt, enc); + } + } + /* * Wipe out everything which is before the first '<' */ @@ -4151,10 +4177,10 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) { while (((CUR == '<') && (NXT(1) == '!') && (NXT(2) == '-') && (NXT(3) == '-')) || ((CUR == '<') && (NXT(1) == '?'))) { - htmlParseComment(ctxt); - htmlParsePI(ctxt); + htmlParseComment(ctxt); + htmlParsePI(ctxt); SKIP_BLANKS; - } + } /* diff --git a/reactos/lib/3rdparty/libxml2/NEWS b/reactos/lib/3rdparty/libxml2/NEWS index 8c343200f8b..6928d5ba88c 100644 --- a/reactos/lib/3rdparty/libxml2/NEWS +++ b/reactos/lib/3rdparty/libxml2/NEWS @@ -15,6 +15,17 @@ ChangeLog.html to the SVN at http://svn.gnome.org/viewcvs/libxml2/trunk/ code base.Here is the list of public releases: +2.7.2: Oct 3 2008: + - Portability fix: fix solaris compilation problem, fix compilation + if XPath is not configured in + - Bug fixes: nasty entity bug introduced in 2.7.0, restore old behaviour + when saving an HTML doc with an xml dump function, HTML UTF-8 parsing + bug, fix reader custom error handlers (Riccardo Scussat) + + - Improvement: xmlSave options for more flexibility to save as + XML/HTML/XHTML, handle leading BOM in HTML documents + + 2.7.1: Sep 1 2008: - Portability fix: Borland C fix (Moritz Both) - Bug fixes: python serialization wrappers, XPath QName corner diff --git a/reactos/lib/3rdparty/libxml2/config.h.in b/reactos/lib/3rdparty/libxml2/config.h.in index f8435d4faeb..1285789027d 100644 --- a/reactos/lib/3rdparty/libxml2/config.h.in +++ b/reactos/lib/3rdparty/libxml2/config.h.in @@ -85,6 +85,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H_H + /* Define if isinf is there */ #undef HAVE_ISINF diff --git a/reactos/lib/3rdparty/libxml2/configure b/reactos/lib/3rdparty/libxml2/configure index e782bfb37b1..fa9aa59576b 100644 --- a/reactos/lib/3rdparty/libxml2/configure +++ b/reactos/lib/3rdparty/libxml2/configure @@ -2191,7 +2191,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=1 +LIBXML_MICRO_VERSION=2 LIBXML_MICRO_VERSION_SUFFIX= LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION @@ -22663,6 +22663,286 @@ fi done +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in inttypes.h.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + for ac_header in time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -26382,7 +26662,7 @@ fi { echo "$as_me:$LINENO: checking for type of socket length (socklen_t)" >&5 echo $ECHO_N "checking for type of socket length (socklen_t)... $ECHO_C" >&6; } cat > conftest.$ac_ext < @@ -26393,7 +26673,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { echo "$as_me:$LINENO: result: socklen_t *" >&5 @@ -26405,7 +26685,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26416,7 +26696,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) ; return 0; } EOF -if { (eval echo configure:26419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { echo "$as_me:$LINENO: result: size_t *" >&5 @@ -26428,7 +26708,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -26439,7 +26719,7 @@ int main(void) { (void)getsockopt (1, 1, 1, NULL, (int *)NULL) ; return 0; } EOF -if { (eval echo configure:26442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then +if { (eval echo configure:26722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then rm -rf conftest* { echo "$as_me:$LINENO: result: int *" >&5 diff --git a/reactos/lib/3rdparty/libxml2/configure.in b/reactos/lib/3rdparty/libxml2/configure.in index 17dad0b78e5..04f363fb905 100644 --- a/reactos/lib/3rdparty/libxml2/configure.in +++ b/reactos/lib/3rdparty/libxml2/configure.in @@ -5,7 +5,7 @@ AC_CANONICAL_HOST LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=7 -LIBXML_MICRO_VERSION=1 +LIBXML_MICRO_VERSION=2 LIBXML_MICRO_VERSION_SUFFIX= LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION @@ -378,6 +378,8 @@ AC_CHECK_HEADERS([malloc.h]) AC_CHECK_HEADERS([stdarg.h]) AC_CHECK_HEADERS([sys/stat.h]) AC_CHECK_HEADERS([sys/types.h]) +AC_CHECK_HEADERS([stdint.h]) +AC_CHECK_HEADERS([inttypes.h.h]) AC_CHECK_HEADERS([time.h]) AC_CHECK_HEADERS([ansidecl.h]) AC_CHECK_HEADERS([ieeefp.h]) diff --git a/reactos/lib/3rdparty/libxml2/dict.c b/reactos/lib/3rdparty/libxml2/dict.c index 20bd3104c55..0e07e8dcbea 100644 --- a/reactos/lib/3rdparty/libxml2/dict.c +++ b/reactos/lib/3rdparty/libxml2/dict.c @@ -22,9 +22,13 @@ #include #ifdef HAVE_STDINT_H #include +#else +#ifdef HAVE_INTTYPES_H +#include #elif defined(WIN32) typedef unsigned __int32 uint32_t; #endif +#endif #include #include #include diff --git a/reactos/lib/3rdparty/libxml2/libxml2.spec b/reactos/lib/3rdparty/libxml2/libxml2.spec index 039c198c352..a6da3085981 100644 --- a/reactos/lib/3rdparty/libxml2/libxml2.spec +++ b/reactos/lib/3rdparty/libxml2/libxml2.spec @@ -1,6 +1,6 @@ Summary: Library providing XML and HTML support Name: libxml2 -Version: 2.7.1 +Version: 2.7.2 Release: 1 License: MIT Group: Development/Libraries @@ -128,6 +128,6 @@ rm -fr %{buildroot} %doc doc/python.html %changelog -* Mon Sep 1 2008 Daniel Veillard -- upstream release 2.7.1 see http://xmlsoft.org/news.html +* Fri Oct 3 2008 Daniel Veillard +- upstream release 2.7.2 see http://xmlsoft.org/news.html diff --git a/reactos/lib/3rdparty/libxml2/parser.c b/reactos/lib/3rdparty/libxml2/parser.c index 9876a469480..4b7b7584dd1 100644 --- a/reactos/lib/3rdparty/libxml2/parser.c +++ b/reactos/lib/3rdparty/libxml2/parser.c @@ -7215,6 +7215,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { } if (*ptr != ';') { xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL); + xmlFree(name); *str = ptr; return(NULL); } @@ -7225,8 +7226,11 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { * Predefined entites override any extra definition */ ent = xmlGetPredefinedEntity(name); - if (ent != NULL) + if (ent != NULL) { + xmlFree(name); + *str = ptr; return(ent); + } /* * Increate the number of entity references parsed diff --git a/reactos/lib/3rdparty/libxml2/runxmlconf.c b/reactos/lib/3rdparty/libxml2/runxmlconf.c index 8ef7f747160..38b0ce468b9 100644 --- a/reactos/lib/3rdparty/libxml2/runxmlconf.c +++ b/reactos/lib/3rdparty/libxml2/runxmlconf.c @@ -12,6 +12,8 @@ #include #endif +#ifdef LIBXML_XPATH_ENABLED + #if !defined(_WIN32) || defined(__CYGWIN__) #include #endif @@ -605,3 +607,11 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { fclose(logfile); return(ret); } + +#else /* ! LIBXML_XPATH_ENABLED */ +#include +int +main(int argc, char **argv) { + fprintf(stderr, "%s need XPath support\n", argv[0]); +} +#endif diff --git a/reactos/lib/3rdparty/libxml2/xmlreader.c b/reactos/lib/3rdparty/libxml2/xmlreader.c index bd47ea51799..d42b1a0c6b7 100644 --- a/reactos/lib/3rdparty/libxml2/xmlreader.c +++ b/reactos/lib/3rdparty/libxml2/xmlreader.c @@ -44,6 +44,27 @@ #include #endif +#define MAX_ERR_MSG_SIZE 64000 + +/* + * The following VA_COPY was coded following an example in + * the Samba project. It may not be sufficient for some + * esoteric implementations of va_list (i.e. it may need + * something involving a memcpy) but (hopefully) will be + * sufficient for libxml2. + */ +#ifndef VA_COPY + #ifdef HAVE_VA_COPY + #define VA_COPY(dest, src) va_copy(dest, src) + #else + #ifdef HAVE___VA_COPY + #define VA_COPY(dest,src) __va_copy(dest, src) + #else + #define VA_COPY(dest,src) (dest) = (src) + #endif + #endif +#endif + /* #define DEBUG_CALLBACKS */ /* #define DEBUG_READER */ @@ -4500,30 +4521,32 @@ xmlTextReaderStandalone(xmlTextReaderPtr reader) { /* helper to build a xmlMalloc'ed string from a format and va_list */ static char * xmlTextReaderBuildMessage(const char *msg, va_list ap) { - int size; + int size = 0; int chars; char *larger; - char *str; - - str = (char *) xmlMallocAtomic(150); - if (str == NULL) { - xmlGenericError(xmlGenericErrorContext, "xmlMalloc failed !\n"); - return NULL; - } - - size = 150; + char *str = NULL; + va_list aq; while (1) { - chars = vsnprintf(str, size, msg, ap); - if ((chars > -1) && (chars < size)) + VA_COPY(aq, ap); + chars = vsnprintf(str, size, msg, aq); + va_end(aq); + if (chars < 0) { + xmlGenericError(xmlGenericErrorContext, "vsnprintf failed !\n"); + if (str) + xmlFree(str); + return NULL; + } + if ((chars < size) || (size == MAX_ERR_MSG_SIZE)) break; - if (chars > -1) - size += chars + 1; - else - size += 100; + if (chars < MAX_ERR_MSG_SIZE) + size = chars + 1; + else + size = MAX_ERR_MSG_SIZE; if ((larger = (char *) xmlRealloc(str, size)) == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlRealloc failed !\n"); - xmlFree(str); + if (str) + xmlFree(str); return NULL; } str = larger; diff --git a/reactos/lib/3rdparty/libxml2/xmlsave.c b/reactos/lib/3rdparty/libxml2/xmlsave.c index a6507221efd..53b23e6ceba 100644 --- a/reactos/lib/3rdparty/libxml2/xmlsave.c +++ b/reactos/lib/3rdparty/libxml2/xmlsave.c @@ -757,8 +757,14 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) { return; } #ifdef LIBXML_HTML_ENABLED - if ((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) && - (cur->doc->type == XML_HTML_DOCUMENT_NODE)) { + if (ctxt->options & XML_SAVE_XHTML) { + xhtmlNodeDumpOutput(ctxt, cur); + return; + } + if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) && + (cur->doc->type == XML_HTML_DOCUMENT_NODE) && + ((ctxt->options & XML_SAVE_AS_XML) == 0)) || + (ctxt->options & XML_SAVE_AS_HTML)) { htmlNodeDumpOutputInternal(ctxt, cur); return; } @@ -953,7 +959,10 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { xmlGetCharEncodingName((xmlCharEncoding) cur->charset); } - if (cur->type == XML_HTML_DOCUMENT_NODE) { + if (((cur->type == XML_HTML_DOCUMENT_NODE) && + ((ctxt->options & XML_SAVE_AS_XML) == 0) && + ((ctxt->options & XML_SAVE_XHTML) == 0)) || + (ctxt->options & XML_SAVE_AS_HTML)) { #ifdef LIBXML_HTML_ENABLED if (encoding != NULL) htmlSetMetaEncoding(cur, (const xmlChar *) encoding); @@ -981,7 +990,9 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { #else return(-1); #endif - } else if (cur->type == XML_DOCUMENT_NODE) { + } else if ((cur->type == XML_DOCUMENT_NODE) || + (ctxt->options & XML_SAVE_AS_XML) || + (ctxt->options & XML_SAVE_XHTML)) { enc = xmlParseCharEncoding((const char*) encoding); if ((encoding != NULL) && (oldctxtenc == NULL) && (buf->encoder == NULL) && (buf->conv == NULL) && @@ -1032,6 +1043,8 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) { } #ifdef LIBXML_HTML_ENABLED + if (ctxt->options & XML_SAVE_XHTML) + is_xhtml = 1; if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) { dtd = xmlGetIntSubset(cur); if (dtd != NULL) { @@ -2123,6 +2136,7 @@ xmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; #ifdef LIBXML_HTML_ENABLED dtd = xmlGetIntSubset(doc); @@ -2208,6 +2222,7 @@ xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr, ctxt.format = format; ctxt.encoding = (const xmlChar *) txt_encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, out_doc); xmlOutputBufferFlush(out_buff); if (out_buff->conv != NULL) { @@ -2326,6 +2341,7 @@ xmlDocFormatDump(FILE *f, xmlDocPtr cur, int format) { ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur); ret = xmlOutputBufferClose(buf); @@ -2375,6 +2391,7 @@ xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) { ctxt.format = 0; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur); ret = xmlOutputBufferClose(buf); return(ret); @@ -2414,6 +2431,7 @@ xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur); ret = xmlOutputBufferClose(buf); return (ret); @@ -2468,6 +2486,7 @@ xmlSaveFormatFileEnc( const char * filename, xmlDocPtr cur, ctxt.format = format; ctxt.encoding = (const xmlChar *) encoding; xmlSaveCtxtInit(&ctxt); + ctxt.options |= XML_SAVE_AS_XML; xmlDocContentDumpOutput(&ctxt, cur);