update libxml2 to 2.7.2

svn path=/trunk/; revision=38604
This commit is contained in:
Christoph von Wittich 2009-01-06 10:24:26 +00:00
parent 38418a1b4c
commit 76d01f9028
14 changed files with 462 additions and 41 deletions

View file

@ -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;

View file

@ -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

View file

@ -1,3 +1,39 @@
Fri Oct 3 09:43:45 CEST 2008 Daniel Veillard <daniel@veillard.com>
* 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 <daniel@veillard.com>
* 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 <daniel@veillard.com>
* 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 <daniel@veillard.com>
* runxmlconf.c: fix compilation if XPath is not included
Thu Sep 25 16:54:04 CEST 2008 Daniel Veillard <daniel@veillard.com>
* xmlreader.c: patch from Riccardo Scussat fixing custom error
handlers problems.
Thu Sep 25 16:30:11 CEST 2008 Daniel Veillard <daniel@veillard.com>
* 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 <daniel@veillard.com>
* doc/xml.html doc/news.html configure.in python/setup.py NEWS:

View file

@ -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;
}
}
/*

View file

@ -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

View file

@ -85,6 +85,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <inttypes.h.h> header file. */
#undef HAVE_INTTYPES_H_H
/* Define if isinf is there */
#undef HAVE_ISINF

View file

@ -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 <<EOF
#line 26385 "configure"
#line 26665 "configure"
#include "confdefs.h"
#include <stddef.h>
@ -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 <<EOF
#line 26408 "configure"
#line 26688 "configure"
#include "confdefs.h"
#include <stddef.h>
@ -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 <<EOF
#line 26431 "configure"
#line 26711 "configure"
#include "confdefs.h"
#include <stddef.h>
@ -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

View file

@ -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])

View file

@ -22,9 +22,13 @@
#include <string.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#elif defined(WIN32)
typedef unsigned __int32 uint32_t;
#endif
#endif
#include <libxml/tree.h>
#include <libxml/dict.h>
#include <libxml/xmlmemory.h>

View file

@ -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 <veillard@redhat.com>
- upstream release 2.7.1 see http://xmlsoft.org/news.html
* Fri Oct 3 2008 Daniel Veillard <veillard@redhat.com>
- upstream release 2.7.2 see http://xmlsoft.org/news.html

View file

@ -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

View file

@ -12,6 +12,8 @@
#include <stdio.h>
#endif
#ifdef LIBXML_XPATH_ENABLED
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <unistd.h>
#endif
@ -605,3 +607,11 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
fclose(logfile);
return(ret);
}
#else /* ! LIBXML_XPATH_ENABLED */
#include <stdio.h>
int
main(int argc, char **argv) {
fprintf(stderr, "%s need XPath support\n", argv[0]);
}
#endif

View file

@ -44,6 +44,27 @@
#include <libxml/pattern.h>
#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;

View file

@ -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);