Imported Upstream version 2.9.9 upstream/2.9.9
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 10 Oct 2019 05:47:48 +0000 (14:47 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 10 Oct 2019 05:47:48 +0000 (14:47 +0900)
74 files changed:
HTMLparser.c
HTMLtree.c
INSTALL
Makefile.in
SAX2.c
aclocal.m4
autogen.sh
c14n.c
compile
config.guess
config.sub
configure
configure.ac
depcomp
doc/Makefile.in
doc/devhelp/Makefile.in
doc/examples/Makefile.in
doc/libxml2.xsa
doc/news.html
doc/xml.html
encoding.c
example/Makefile.in
include/Makefile.in
include/libxml/Makefile.in
include/libxml/globals.h
include/libxml/tree.h
include/libxml/xmlexports.h
include/libxml/xmlversion.h
install-sh
libxml2.spec
libxml2.syms
ltmain.sh
missing
parser.c
parserInternals.c
python/Makefile.in
python/setup.py
python/tests/Makefile.in
relaxng.c
result/errors/759573.xml.err
result/relaxng/anyName0_0 [new file with mode: 0644]
result/relaxng/anyName0_0.err [new file with mode: 0644]
result/relaxng/anyName0_err [new file with mode: 0644]
result/relaxng/anyName0_valid [new file with mode: 0644]
result/relaxng/include0_0 [new file with mode: 0644]
result/relaxng/include0_0.err [new file with mode: 0644]
result/relaxng/include0_err [new file with mode: 0644]
result/relaxng/include0_valid [new file with mode: 0644]
result/relaxng/include1_0 [new file with mode: 0644]
result/relaxng/include1_0.err [new file with mode: 0644]
result/relaxng/include1_err [new file with mode: 0644]
result/relaxng/include1_valid [new file with mode: 0644]
runtest.c
test/relaxng/anyName0.rng [new file with mode: 0644]
test/relaxng/anyName0_0.xml [new file with mode: 0644]
test/relaxng/include0.inc [new file with mode: 0644]
test/relaxng/include0.rng [new file with mode: 0644]
test/relaxng/include0_0.xml [new file with mode: 0644]
test/relaxng/include1-0.inc [new file with mode: 0644]
test/relaxng/include1-1.inc [new file with mode: 0644]
test/relaxng/include1.rng [new file with mode: 0644]
test/relaxng/include1_0.xml [new file with mode: 0644]
testURI.c
testapi.c
uri.c
win32/Makefile.msvc
xmlIO.c
xmllint.c
xmlreader.c
xmlsave.c
xmlschemas.c
xpath.c
xstc/Makefile.in
xzlib.c

index 9adeb17..9e60e27 100644 (file)
@@ -1084,7 +1084,7 @@ static const char * const htmlStartClose[] = {
 "menu",                "p", "head", "ul", NULL,
 "p",           "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL,
 "div",         "p", "head", NULL,
-"noscript",    "p", NULL,
+"noscript",    "script", NULL,
 "center",      "font", "b", "i", "p", "head", NULL,
 "a",           "a", "head", NULL,
 "caption",     "p", NULL,
@@ -3635,13 +3635,13 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
             */
            processed = ctxt->input->cur - ctxt->input->base;
            xmlBufShrink(ctxt->input->buf->buffer, processed);
-           nbchars = xmlCharEncInput(ctxt->input->buf, 0);
+           nbchars = xmlCharEncInput(ctxt->input->buf, 1);
+            xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input);
            if (nbchars < 0) {
                htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
                             "htmlCheckEncoding: encoder error\n",
                             NULL, NULL);
            }
-            xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input);
        }
     }
 }
index 2fd0c9c..21cfcfe 100644 (file)
@@ -502,17 +502,17 @@ htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc,
            if (handler == NULL)
                htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
        }
+    } else {
+        /*
+         * Fallback to HTML or ASCII when the encoding is unspecified
+         */
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("HTML");
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("ascii");
     }
 
     /*
-     * Fallback to HTML or ASCII when the encoding is unspecified
-     */
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("HTML");
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("ascii");
-
-    /*
      * save the content to a temp buffer.
      */
     buf = xmlOutputBufferCreateFile(out, handler);
@@ -570,33 +570,22 @@ htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
        xmlCharEncoding enc;
 
        enc = xmlParseCharEncoding(encoding);
-       if (enc != cur->charset) {
-           if (cur->charset != XML_CHAR_ENCODING_UTF8) {
-               /*
-                * Not supported yet
-                */
-               *mem = NULL;
-               *size = 0;
-               return;
-           }
-
+       if (enc != XML_CHAR_ENCODING_UTF8) {
            handler = xmlFindCharEncodingHandler(encoding);
            if (handler == NULL)
                 htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
 
-       } else {
-           handler = xmlFindCharEncodingHandler(encoding);
        }
+    } else {
+        /*
+         * Fallback to HTML or ASCII when the encoding is unspecified
+         */
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("HTML");
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("ascii");
     }
 
-    /*
-     * Fallback to HTML or ASCII when the encoding is unspecified
-     */
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("HTML");
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("ascii");
-
     buf = xmlAllocOutputBufferInternal(handler);
     if (buf == NULL) {
        *mem = NULL;
@@ -1101,30 +1090,21 @@ htmlDocDump(FILE *f, xmlDocPtr cur) {
        xmlCharEncoding enc;
 
        enc = xmlParseCharEncoding(encoding);
-       if (enc != cur->charset) {
-           if (cur->charset != XML_CHAR_ENCODING_UTF8) {
-               /*
-                * Not supported yet
-                */
-               return(-1);
-           }
-
+       if (enc != XML_CHAR_ENCODING_UTF8) {
            handler = xmlFindCharEncodingHandler(encoding);
            if (handler == NULL)
                htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
-       } else {
-           handler = xmlFindCharEncodingHandler(encoding);
        }
+    } else {
+        /*
+         * Fallback to HTML or ASCII when the encoding is unspecified
+         */
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("HTML");
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("ascii");
     }
 
-    /*
-     * Fallback to HTML or ASCII when the encoding is unspecified
-     */
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("HTML");
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("ascii");
-
     buf = xmlOutputBufferCreateFile(f, handler);
     if (buf == NULL) return(-1);
     htmlDocContentDumpOutput(buf, cur, NULL);
@@ -1160,29 +1140,22 @@ htmlSaveFile(const char *filename, xmlDocPtr cur) {
        xmlCharEncoding enc;
 
        enc = xmlParseCharEncoding(encoding);
-       if (enc != cur->charset) {
-           if (cur->charset != XML_CHAR_ENCODING_UTF8) {
-               /*
-                * Not supported yet
-                */
-               return(-1);
-           }
-
+       if (enc != XML_CHAR_ENCODING_UTF8) {
            handler = xmlFindCharEncodingHandler(encoding);
            if (handler == NULL)
                htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
        }
+    } else {
+        /*
+         * Fallback to HTML or ASCII when the encoding is unspecified
+         */
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("HTML");
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("ascii");
     }
 
     /*
-     * Fallback to HTML or ASCII when the encoding is unspecified
-     */
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("HTML");
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("ascii");
-
-    /*
      * save the content to a temp buffer.
      */
     buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
@@ -1221,14 +1194,7 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
        xmlCharEncoding enc;
 
        enc = xmlParseCharEncoding(encoding);
-       if (enc != cur->charset) {
-           if (cur->charset != XML_CHAR_ENCODING_UTF8) {
-               /*
-                * Not supported yet
-                */
-               return(-1);
-           }
-
+       if (enc != XML_CHAR_ENCODING_UTF8) {
            handler = xmlFindCharEncodingHandler(encoding);
            if (handler == NULL)
                htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
@@ -1236,15 +1202,15 @@ htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
         htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
     } else {
        htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8");
-    }
 
-    /*
-     * Fallback to HTML or ASCII when the encoding is unspecified
-     */
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("HTML");
-    if (handler == NULL)
-       handler = xmlFindCharEncodingHandler("ascii");
+        /*
+         * Fallback to HTML or ASCII when the encoding is unspecified
+         */
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("HTML");
+        if (handler == NULL)
+            handler = xmlFindCharEncodingHandler("ascii");
+    }
 
     /*
      * save the content to a temp buffer.
diff --git a/INSTALL b/INSTALL
index 2099840..8865734 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
-Inc.
+   Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
+Foundation, Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -12,97 +12,96 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell command `./configure && make && make install'
+   Briefly, the shell command './configure && make && make install'
 should configure, build, and install this package.  The following
-more-detailed instructions are generic; see the `README' file for
+more-detailed instructions are generic; see the 'README' file for
 instructions specific to this package.  Some packages provide this
-`INSTALL' file but do not implement all of the features documented
+'INSTALL' file but do not implement all of the features documented
 below.  The lack of an optional feature in a given package is not
 necessarily a bug.  More recommendations for GNU packages can be found
 in *note Makefile Conventions: (standards)Makefile Conventions.
 
-   The `configure' shell script attempts to guess correct values for
+   The 'configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
+those values to create a 'Makefile' in each directory of the package.
+It may also create one or more '.h' files containing system-dependent
+definitions.  Finally, it creates a shell script 'config.status' that
 you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
+file 'config.log' containing compiler output (useful mainly for
+debugging 'configure').
 
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.
+   It can also use an optional file (typically called 'config.cache' and
+enabled with '--cache-file=config.cache' or simply '-C') that saves the
+results of its tests to speed up reconfiguring.  Caching is disabled by
+default to prevent problems with accidental use of stale cache files.
 
    If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
+to figure out how 'configure' could check whether to do them, and mail
+diffs or instructions to the address given in the 'README' so they can
 be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
+some point 'config.cache' contains results you don't want to keep, you
 may remove or edit it.
 
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+   The file 'configure.ac' (or 'configure.in') is used to create
+'configure' by a program called 'autoconf'.  You need 'configure.ac' if
+you want to change it or regenerate 'configure' using a newer version of
+'autoconf'.
 
    The simplest way to compile this package is:
 
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.
+  1. 'cd' to the directory containing the package's source code and type
+     './configure' to configure the package for your system.
 
-     Running `configure' might take a while.  While running, it prints
+     Running 'configure' might take a while.  While running, it prints
      some messages telling which features it is checking for.
 
-  2. Type `make' to compile the package.
+  2. Type 'make' to compile the package.
 
-  3. Optionally, type `make check' to run any self-tests that come with
+  3. Optionally, type 'make check' to run any self-tests that come with
      the package, generally using the just-built uninstalled binaries.
 
-  4. Type `make install' to install the programs and any data files and
+  4. Type 'make install' to install the programs and any data files and
      documentation.  When installing into a prefix owned by root, it is
      recommended that the package be configured and built as a regular
-     user, and only the `make install' phase executed with root
+     user, and only the 'make install' phase executed with root
      privileges.
 
-  5. Optionally, type `make installcheck' to repeat any self-tests, but
+  5. Optionally, type 'make installcheck' to repeat any self-tests, but
      this time using the binaries in their final installed location.
      This target does not install anything.  Running this target as a
-     regular user, particularly if the prior `make install' required
+     regular user, particularly if the prior 'make install' required
      root privileges, verifies that the installation completed
      correctly.
 
   6. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
+     source code directory by typing 'make clean'.  To also remove the
+     files that 'configure' created (so you can compile the package for
+     a different kind of computer), type 'make distclean'.  There is
+     also a 'make maintainer-clean' target, but that is intended mainly
      for the package's developers.  If you use it, you may have to get
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
-  7. Often, you can also type `make uninstall' to remove the installed
+  7. Often, you can also type 'make uninstall' to remove the installed
      files again.  In practice, not all packages have tested that
      uninstallation works correctly, even though it is required by the
      GNU Coding Standards.
 
-  8. Some packages, particularly those that use Automake, provide `make
+  8. Some packages, particularly those that use Automake, provide 'make
      distcheck', which can by used by developers to test that all other
-     targets like `make install' and `make uninstall' work correctly.
+     targets like 'make install' and 'make uninstall' work correctly.
      This target is generally not run by end users.
 
 Compilers and Options
 =====================
 
    Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  Run `./configure --help'
+the 'configure' script does not know about.  Run './configure --help'
 for details on some of the pertinent environment variables.
 
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
+   You can give 'configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here is
+an example:
 
      ./configure CC=c99 CFLAGS=-g LIBS=-lposix
 
@@ -113,21 +112,21 @@ Compiling For Multiple Architectures
 
    You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you can use GNU `make'.  `cd' to the
+own directory.  To do this, you can use GNU 'make'.  'cd' to the
 directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.  This
-is known as a "VPATH" build.
+the 'configure' script.  'configure' automatically checks for the source
+code in the directory that 'configure' is in and in '..'.  This is known
+as a "VPATH" build.
 
-   With a non-GNU `make', it is safer to compile the package for one
+   With a non-GNU 'make', it is safer to compile the package for one
 architecture at a time in the source code directory.  After you have
-installed the package for one architecture, use `make distclean' before
+installed the package for one architecture, use 'make distclean' before
 reconfiguring for another architecture.
 
    On MacOS X 10.5 and later systems, you can create libraries and
 executables that work on multiple system types--known as "fat" or
-"universal" binaries--by specifying multiple `-arch' options to the
-compiler but only a single `-arch' option to the preprocessor.  Like
+"universal" binaries--by specifying multiple '-arch' options to the
+compiler but only a single '-arch' option to the preprocessor.  Like
 this:
 
      ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
@@ -136,105 +135,104 @@ this:
 
    This is not guaranteed to produce working output in all cases, you
 may have to build one architecture at a time and combine the results
-using the `lipo' tool if you have problems.
+using the 'lipo' tool if you have problems.
 
 Installation Names
 ==================
 
-   By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc.  You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX', where PREFIX must be an
+   By default, 'make install' installs the package's commands under
+'/usr/local/bin', include files under '/usr/local/include', etc.  You
+can specify an installation prefix other than '/usr/local' by giving
+'configure' the option '--prefix=PREFIX', where PREFIX must be an
 absolute file name.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
 PREFIX as the prefix for installing programs and libraries.
 Documentation and other data files still use the regular prefix.
 
    In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.  In general, the
-default for these options is expressed in terms of `${prefix}', so that
-specifying just `--prefix' will affect all of the other directory
+options like '--bindir=DIR' to specify different values for particular
+kinds of files.  Run 'configure --help' for a list of the directories
+you can set and what kinds of files go in them.  In general, the default
+for these options is expressed in terms of '${prefix}', so that
+specifying just '--prefix' will affect all of the other directory
 specifications that were not explicitly provided.
 
    The most portable way to affect installation locations is to pass the
-correct locations to `configure'; however, many packages provide one or
+correct locations to 'configure'; however, many packages provide one or
 both of the following shortcuts of passing variable assignments to the
-`make install' command line to change installation locations without
+'make install' command line to change installation locations without
 having to reconfigure or recompile.
 
    The first method involves providing an override variable for each
-affected directory.  For example, `make install
+affected directory.  For example, 'make install
 prefix=/alternate/directory' will choose an alternate location for all
 directory configuration variables that were expressed in terms of
-`${prefix}'.  Any directories that were specified during `configure',
-but not in terms of `${prefix}', must each be overridden at install
-time for the entire installation to be relocated.  The approach of
-makefile variable overrides for each directory variable is required by
-the GNU Coding Standards, and ideally causes no recompilation.
-However, some platforms have known limitations with the semantics of
-shared libraries that end up requiring recompilation when using this
-method, particularly noticeable in packages that use GNU Libtool.
-
-   The second method involves providing the `DESTDIR' variable.  For
-example, `make install DESTDIR=/alternate/directory' will prepend
-`/alternate/directory' before all installation names.  The approach of
-`DESTDIR' overrides is not required by the GNU Coding Standards, and
+'${prefix}'.  Any directories that were specified during 'configure',
+but not in terms of '${prefix}', must each be overridden at install time
+for the entire installation to be relocated.  The approach of makefile
+variable overrides for each directory variable is required by the GNU
+Coding Standards, and ideally causes no recompilation.  However, some
+platforms have known limitations with the semantics of shared libraries
+that end up requiring recompilation when using this method, particularly
+noticeable in packages that use GNU Libtool.
+
+   The second method involves providing the 'DESTDIR' variable.  For
+example, 'make install DESTDIR=/alternate/directory' will prepend
+'/alternate/directory' before all installation names.  The approach of
+'DESTDIR' overrides is not required by the GNU Coding Standards, and
 does not work on platforms that have drive letters.  On the other hand,
 it does better at avoiding recompilation issues, and works well even
-when some directory options were not specified in terms of `${prefix}'
-at `configure' time.
+when some directory options were not specified in terms of '${prefix}'
+at 'configure' time.
 
 Optional Features
 =================
 
    If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-   Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
+with an extra prefix or suffix on their names by giving 'configure' the
+option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
+
+   Some packages pay attention to '--enable-FEATURE' options to
+'configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to '--with-PACKAGE' options, where PACKAGE
+is something like 'gnu-as' or 'x' (for the X Window System).  The
+'README' should mention any '--enable-' and '--with-' options that the
 package recognizes.
 
-   For packages that use the X Window System, `configure' can usually
+   For packages that use the X Window System, 'configure' can usually
 find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
+you can use the 'configure' options '--x-includes=DIR' and
+'--x-libraries=DIR' to specify their locations.
 
    Some packages offer the ability to configure how verbose the
-execution of `make' will be.  For these packages, running `./configure
+execution of 'make' will be.  For these packages, running './configure
 --enable-silent-rules' sets the default to minimal output, which can be
-overridden with `make V=1'; while running `./configure
+overridden with 'make V=1'; while running './configure
 --disable-silent-rules' sets the default to verbose, which can be
-overridden with `make V=0'.
+overridden with 'make V=0'.
 
 Particular systems
 ==================
 
-   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
-CC is not installed, it is recommended to use the following options in
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU CC
+is not installed, it is recommended to use the following options in
 order to use an ANSI C compiler:
 
      ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
-   HP-UX `make' updates targets which have the same time stamps as
-their prerequisites, which makes it generally unusable when shipped
-generated files such as `configure' are involved.  Use GNU `make'
-instead.
+   HP-UX 'make' updates targets which have the same time stamps as their
+prerequisites, which makes it generally unusable when shipped generated
+files such as 'configure' are involved.  Use GNU 'make' instead.
 
    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
-parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
-a workaround.  If GNU CC is not installed, it is therefore recommended
-to try
+parse its '<wchar.h>' header file.  The option '-nodtk' can be used as a
+workaround.  If GNU CC is not installed, it is therefore recommended to
+try
 
      ./configure CC="cc"
 
@@ -242,26 +240,26 @@ and if that doesn't work, try
 
      ./configure CC="cc -nodtk"
 
-   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+   On Solaris, don't put '/usr/ucb' early in your 'PATH'.  This
 directory contains several dysfunctional programs; working variants of
-these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
-in your `PATH', put it _after_ `/usr/bin'.
+these programs are available in '/usr/bin'.  So, if you need '/usr/ucb'
+in your 'PATH', put it _after_ '/usr/bin'.
 
-   On Haiku, software installed for all users goes in `/boot/common',
-not `/usr/local'.  It is recommended to use the following options:
+   On Haiku, software installed for all users goes in '/boot/common',
+not '/usr/local'.  It is recommended to use the following options:
 
      ./configure --prefix=/boot/common
 
 Specifying the System Type
 ==========================
 
-   There may be some features `configure' cannot figure out
+   There may be some features 'configure' cannot figure out
 automatically, but needs to determine by the type of machine the package
 will run on.  Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
+_same_ architectures, 'configure' can figure that out, but if it prints
 a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
+'--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as 'sun4', or a canonical name which has the form:
 
      CPU-COMPANY-SYSTEM
 
@@ -270,101 +268,101 @@ where SYSTEM can have one of these forms:
      OS
      KERNEL-OS
 
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
+   See the file 'config.sub' for the possible values of each field.  If
+'config.sub' isn't included in this package, then this package doesn't
 need to know the machine type.
 
    If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
+use the option '--target=TYPE' to select the type of system they will
 produce code for.
 
    If you want to _use_ a cross compiler, that generates code for a
 platform different from the build platform, you should specify the
 "host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
+eventually be run) with '--host=TYPE'.
 
 Sharing Defaults
 ================
 
-   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
+   If you want to set default values for 'configure' scripts to share,
+you can create a site shell script called 'config.site' that gives
+default values for variables like 'CC', 'cache_file', and 'prefix'.
+'configure' looks for 'PREFIX/share/config.site' if it exists, then
+'PREFIX/etc/config.site' if it exists.  Or, you can set the
+'CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all 'configure' scripts look for a site script.
 
 Defining Variables
 ==================
 
    Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
+environment passed to 'configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
+them in the 'configure' command line, using 'VAR=value'.  For example:
 
      ./configure CC=/usr/local2/bin/gcc
 
-causes the specified `gcc' to be used as the C compiler (unless it is
+causes the specified 'gcc' to be used as the C compiler (unless it is
 overridden in the site shell script).
 
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf limitation.  Until the limitation is lifted, you can use
-this workaround:
+Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
+Autoconf limitation.  Until the limitation is lifted, you can use this
+workaround:
 
      CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
 
-`configure' Invocation
+'configure' Invocation
 ======================
 
-   `configure' recognizes the following options to control how it
+   'configure' recognizes the following options to control how it
 operates.
 
-`--help'
-`-h'
-     Print a summary of all of the options to `configure', and exit.
+'--help'
+'-h'
+     Print a summary of all of the options to 'configure', and exit.
 
-`--help=short'
-`--help=recursive'
+'--help=short'
+'--help=recursive'
      Print a summary of the options unique to this package's
-     `configure', and exit.  The `short' variant lists options used
-     only in the top level, while the `recursive' variant lists options
-     also present in any nested packages.
+     'configure', and exit.  The 'short' variant lists options used only
+     in the top level, while the 'recursive' variant lists options also
+     present in any nested packages.
 
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
+'--version'
+'-V'
+     Print the version of Autoconf used to generate the 'configure'
      script, and exit.
 
-`--cache-file=FILE'
+'--cache-file=FILE'
      Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     traditionally 'config.cache'.  FILE defaults to '/dev/null' to
      disable caching.
 
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
+'--config-cache'
+'-C'
+     Alias for '--cache-file=config.cache'.
 
-`--quiet'
-`--silent'
-`-q'
+'--quiet'
+'--silent'
+'-q'
      Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
+     suppress all normal output, redirect it to '/dev/null' (any error
      messages will still be shown).
 
-`--srcdir=DIR'
+'--srcdir=DIR'
      Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
+     'configure' can determine that directory automatically.
 
-`--prefix=DIR'
-     Use DIR as the installation prefix.  *note Installation Names::
-     for more details, including other options available for fine-tuning
-     the installation locations.
+'--prefix=DIR'
+     Use DIR as the installation prefix.  *note Installation Names:: for
+     more details, including other options available for fine-tuning the
+     installation locations.
 
-`--no-create'
-`-n'
+'--no-create'
+'-n'
      Run the configure checks, but stop before creating any output
      files.
 
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
+'configure' also accepts some other, not widely useful, options.  Run
+'configure --help' for more details.
index 7088b3f..d35d539 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/SAX2.c b/SAX2.c
index 0f261b7..7642501 100644 (file)
--- a/SAX2.c
+++ b/SAX2.c
@@ -1665,7 +1665,11 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
 #ifdef DEBUG_SAX_TREE
     xmlGenericError(xmlGenericErrorContext, "pushing(%s)\n", name);
 #endif
-    nodePush(ctxt, ret);
+    if (nodePush(ctxt, ret) < 0) {
+        xmlUnlinkNode(ret);
+        xmlFreeNode(ret);
+        return;
+    }
 
     /*
      * Link the child element
@@ -2257,6 +2261,7 @@ xmlSAX2StartElementNs(void *ctx,
        ctxt->freeElems = ret->next;
        ctxt->freeElemsNr--;
        memset(ret, 0, sizeof(xmlNode));
+        ret->doc = ctxt->myDoc;
        ret->type = XML_ELEMENT_NODE;
 
        if (ctxt->dictNames)
@@ -2336,7 +2341,11 @@ xmlSAX2StartElementNs(void *ctx,
     /*
      * We are parsing a new node.
      */
-    nodePush(ctxt, ret);
+    if (nodePush(ctxt, ret) < 0) {
+        xmlUnlinkNode(ret);
+        xmlFreeNode(ret);
+        return;
+    }
 
     /*
      * Link the child element
index 65ee166..3bc0a6f 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -364,7 +364,7 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
         [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
 ])dnl PKG_HAVE_DEFINE_WITH_MODULES
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -379,7 +379,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -395,14 +395,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -454,7 +454,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -485,7 +485,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -676,7 +676,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -752,7 +752,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -949,7 +949,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -970,7 +970,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -992,7 +992,7 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1027,7 +1027,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1077,7 +1077,7 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1116,7 +1116,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1145,7 +1145,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1192,7 +1192,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1211,7 +1211,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1292,7 +1292,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1352,7 +1352,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1380,7 +1380,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1399,7 +1399,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 8b47ea5..d03a40c 100755 (executable)
@@ -67,6 +67,15 @@ fi
 # Replaced by autoreconf below
 autoreconf -if -Wall
 
+if ! grep -q pkg.m4 aclocal.m4; then
+    cat <<EOF
+
+Couldn't find pkg.m4 from pkg-config. Install the appropriate package for
+your distribution or set ACLOCAL_PATH to the directory containing pkg.m4.
+EOF
+    exit 1
+fi
+
 cd $THEDIR
 
 if test x$OBJ_DIR != x; then
@@ -76,6 +85,11 @@ fi
 
 if test -z "$NOCONFIGURE"; then
     $srcdir/configure $EXTRA_ARGS "$@"
-    echo
-    echo "Now type 'make' to compile libxml2."
+    if test "$?" -ne 0; then
+        echo
+        echo "Configure script failed, check config.log for more info."
+    else
+        echo
+        echo "Now type 'make' to compile libxml2."
+    fi
 fi
diff --git a/c14n.c b/c14n.c
index c04ce66..d80ae8b 100644 (file)
--- a/c14n.c
+++ b/c14n.c
@@ -1798,15 +1798,6 @@ xmlC14NNewCtx(xmlDocPtr doc,
     }
 
     /*
-     *  Validate the XML document encoding value, if provided.
-     */
-    if (doc->charset != XML_CHAR_ENCODING_UTF8) {
-        xmlC14NErr(ctx, (xmlNodePtr) doc, XML_C14N_REQUIRES_UTF8,
-                  "xmlC14NNewCtx: source document not in UTF8\n");
-        return (NULL);
-    }
-
-    /*
      * Allocate a new xmlC14NCtxPtr and fill the fields.
      */
     ctx = (xmlC14NCtxPtr) xmlMalloc(sizeof(xmlC14NCtx));
diff --git a/compile b/compile
index a85b723..de0005d 100755 (executable)
--- a/compile
+++ b/compile
@@ -1,9 +1,9 @@
-#! /bin/sh
+#!/bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -255,7 +255,8 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
-  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
     func_cl_wrapper "$@"      # Doesn't return...
     ;;
 esac
@@ -342,6 +343,6 @@ exit $ret
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index 2e9ad7f..717b228 100755 (executable)
@@ -1,8 +1,8 @@
-#! /bin/sh
+#!/bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2016-10-02'
+timestamp='2017-08-08'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2017 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -259,6 +259,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:Sortix:*:*)
        echo ${UNAME_MACHINE}-unknown-sortix
        exit ;;
+    *:Redox:*:*)
+       echo ${UNAME_MACHINE}-unknown-redox
+       exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -837,10 +840,11 @@ EOF
        UNAME_PROCESSOR=`/usr/bin/uname -p`
        case ${UNAME_PROCESSOR} in
            amd64)
-               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-           *)
-               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               UNAME_PROCESSOR=x86_64 ;;
+           i386)
+               UNAME_PROCESSOR=i586 ;;
        esac
+       echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
@@ -1303,14 +1307,21 @@ EOF
        if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
            if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-                   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-                   grep IS_64BIT_ARCH >/dev/null
+                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                      grep IS_64BIT_ARCH >/dev/null
                then
                    case $UNAME_PROCESSOR in
                        i386) UNAME_PROCESSOR=x86_64 ;;
                        powerpc) UNAME_PROCESSOR=powerpc64 ;;
                    esac
                fi
+               # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+               if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+                      (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                      grep IS_PPC >/dev/null
+               then
+                   UNAME_PROCESSOR=powerpc
+               fi
            fi
        elif test "$UNAME_PROCESSOR" = i386 ; then
            # Avoid executing cc on OS X 10.9, as it ships with a stub
@@ -1334,15 +1345,18 @@ EOF
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
+    NEO-*:NONSTOP_KERNEL:*:*)
        echo neo-tandem-nsk${UNAME_RELEASE}
        exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
        exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
+    NSR-*:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
        exit ;;
+    NSX-*:NONSTOP_KERNEL:*:*)
+       echo nsx-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
        exit ;;
@@ -1418,8 +1432,8 @@ cat >&2 <<EOF
 $0: unable to guess system type
 
 This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite
-config.guess and config.sub with the latest versions from:
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
index 7b334f9..f4bafc1 100755 (executable)
@@ -1,8 +1,8 @@
-#! /bin/sh
+#!/bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2016-09-05'
+timestamp='2017-04-02'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2017 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -263,7 +263,7 @@ case $basic_machine in
        | fido | fr30 | frv | ft32 \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | hexagon \
-       | i370 | i860 | i960 | ia64 \
+       | i370 | i860 | i960 | ia16 | ia64 \
        | ip2k | iq2000 \
        | k1om \
        | le32 | le64 \
@@ -301,6 +301,7 @@ case $basic_machine in
        | open8 | or1k | or1knd | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle \
+       | pru \
        | pyramid \
        | riscv32 | riscv64 \
        | rl78 | rx \
@@ -314,6 +315,7 @@ case $basic_machine in
        | ubicom32 \
        | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
        | visium \
+       | wasm32 \
        | we32k \
        | x86 | xc16x | xstormy16 | xtensa \
        | z8k | z80)
@@ -387,7 +389,7 @@ case $basic_machine in
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | hexagon-* \
-       | i*86-* | i860-* | i960-* | ia64-* \
+       | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
        | ip2k-* | iq2000-* \
        | k1om-* \
        | le32-* | le64-* \
@@ -428,6 +430,7 @@ case $basic_machine in
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+       | pru-* \
        | pyramid-* \
        | riscv32-* | riscv64-* \
        | rl78-* | romp-* | rs6000-* | rx-* \
@@ -444,6 +447,7 @@ case $basic_machine in
        | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
        | vax-* \
        | visium-* \
+       | wasm32-* \
        | we32k-* \
        | x86-* | x86_64-* | xc16x-* | xps100-* \
        | xstormy16-* | xtensa*-* \
@@ -946,6 +950,9 @@ case $basic_machine in
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
+       nsx-tandem)
+               basic_machine=nsx-tandem
+               ;;
        op50n-* | op60c-*)
                basic_machine=hppa1.1-oki
                os=-proelf
@@ -1241,6 +1248,9 @@ case $basic_machine in
                basic_machine=a29k-wrs
                os=-vxworks
                ;;
+       wasm32)
+               basic_machine=wasm32-unknown
+               ;;
        w65*)
                basic_machine=w65-wdc
                os=-none
@@ -1395,7 +1405,7 @@ case $os in
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* | -cegcc* \
+             | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
              | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
              | -linux-newlib* | -linux-musl* | -linux-uclibc* \
@@ -1407,7 +1417,7 @@ case $os in
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
              | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-             | -onefs* | -tirtos* | -phoenix*)
+             | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1636,6 +1646,9 @@ case $basic_machine in
        sparc-* | *-sun)
                os=-sunos4.1.1
                ;;
+       pru-*)
+               os=-elf
+               ;;
        *-be)
                os=-beos
                ;;
index 401b741..12a4e39 100755 (executable)
--- a/configure
+++ b/configure
@@ -2630,7 +2630,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 LIBXML_MAJOR_VERSION=2
 LIBXML_MINOR_VERSION=9
-LIBXML_MICRO_VERSION=8
+LIBXML_MICRO_VERSION=9
 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
index 370e2de..ca911f3 100644 (file)
@@ -9,7 +9,7 @@ AC_CANONICAL_HOST
 
 LIBXML_MAJOR_VERSION=2
 LIBXML_MINOR_VERSION=9
-LIBXML_MICRO_VERSION=8
+LIBXML_MICRO_VERSION=9
 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
diff --git a/depcomp b/depcomp
index fc98710..30379e2 100755 (executable)
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
-#! /bin/sh
+#!/bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2013-05-30.07; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -786,6 +786,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index 6d12704..c4fef83 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 174e1fe..af7636e 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 15d0788..d5696ab 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 33f3848..7f4c048 100644 (file)
@@ -8,45 +8,51 @@
   </vendor>
   <product id="libxml2">
     <name>libxml2</name>
-    <version>2.9.7</version>
-    <last-release> Nov 02 2017</last-release>
+    <version>v2.9.8</version>
+    <last-release> Mar 05 2018</last-release>
     <info-url>http://xmlsoft.org/</info-url>
-    <changes>   - Documentation:
-  xmlcatalog: refresh man page wrt. quering system catalog easily (Jan Pokorný)
-  
-   - Portability:
-  Fix deprecated Travis compiler flag (Nick Wellnhofer),
-  Add declaration for DllMain (J. Peter Mugaas),
-  Fix preprocessor conditional in threads.h (J. Peter Mugaas),
-  Fix pointer comparison warnings on 64-bit Windows (J. Peter Mugaas),
-  Fix macro redefinition warning (J. Peter Mugaas),
-  Default to native threads on MinGW-w64 (Nick Wellnhofer),
-  Simplify Windows IO functions (Nick Wellnhofer),
-  Fix runtest on Windows (Nick Wellnhofer),
-  socklen_t is always int on Windows (Nick Wellnhofer),
-  Don't redefine socket error codes on Windows (Nick Wellnhofer),
-  Fix pointer/int cast warnings on 64-bit Windows (Nick Wellnhofer),
-  Fix Windows compiler warnings in xmlCanonicPath (Nick Wellnhofer)
+    <changes>   - Portability:
+  python: remove single use of _PyVerify_fd (Patrick Welche),
+  Build more test executables on Windows/MSVC (Nick Wellnhofer),
+  Stop including ansidecl.h (Nick Wellnhofer),
+  Fix libz and liblzma detection (Nick Wellnhofer),
+  Revert "Compile testapi with -Wno-unused-function" (Nick Wellnhofer)
   
    - Bug Fixes:
-  xmlcatalog: restore ability to query system catalog easily (Jan Pokorný),
-  Fix comparison of nodesets to strings (Nick Wellnhofer)
+  Fix xmlParserEntityCheck (Nick Wellnhofer),
+  Halt parser in case of encoding error (Nick Wellnhofer),
+  Clear entity content in case of errors (Nick Wellnhofer),
+  Change calls to xmlCharEncInput to set flush false when not final call. Having flush incorrectly set to true causes errors for ICU. (Joel Hockey),
+  Fix buffer over-read in xmlParseNCNameComplex (Nick Wellnhofer),
+  Fix ICU library filenames on Windows/MSVC (Nick Wellnhofer),
+  Fix xmlXPathIsNaN broken by recent commit (Nick Wellnhofer),
+  Fix -Wenum-compare warnings (Nick Wellnhofer),
+  Fix callback signature in testapi.c (Nick Wellnhofer),
+  Fix unused parameter warning without ICU (Nick Wellnhofer),
+  Fix IO callback signatures (Nick Wellnhofer),
+  Fix misc callback signatures (Nick Wellnhofer),
+  Fix list callback signatures (Nick Wellnhofer),
+  Fix hash callback signatures (Nick Wellnhofer),
+  Refactor name and type signature for xmlNop (Vlad Tsyrklevich),
+  Fixed ICU to set flush correctly and provide pivot buffer. (Joel Hockey),
+  Skip EBCDIC tests if EBCDIC isn't supported (Nick Wellnhofer)
   
    - Improvements:
-  Add Makefile rules to rebuild HTML man pages (Nick Wellnhofer),
-  Fix mixed decls and code in timsort.h (Nick Wellnhofer),
-  Rework handling of return values in thread tests (Nick Wellnhofer),
-  Fix unused variable warnings in testrecurse (Nick Wellnhofer),
-  Fix -Wimplicit-fallthrough warnings (J. Peter Mugaas),
-  Upgrade timsort.h to latest revision (Nick Wellnhofer),
-  Increase warning level to /W3 under MSVC (Nick Wellnhofer),
-  Fix a couple of warnings in dict.c and threads.c (Nick Wellnhofer),
-  Update .gitignore for Windows (Nick Wellnhofer),
-  Fix unused variable warnings in nanohttp.c (Nick Wellnhofer),
-  Fix the Windows header mess (Nick Wellnhofer),
-  Don't include winsock2.h in xmllint.c (Nick Wellnhofer),
-  Remove generated file python/setup.py from version control (Nick Wellnhofer),
-  Use __linux__ macro in generated code (Nick Wellnhofer)
+  Disable pointer-overflow UBSan checks under Travis (Nick Wellnhofer),
+  Improve handling of context input_id (Daniel Veillard),
+  Add resource file to Windows DLL (ccpaging),
+  Run Travis tests with -Werror (Nick Wellnhofer),
+  Build with "-Wall -Wextra" (Nick Wellnhofer),
+  Fix -Wtautological-pointer-compare warnings (Nick Wellnhofer),
+  Remove unused AC_CHECKs (Nick Wellnhofer),
+  Update information about contributing (Nick Wellnhofer),
+  Fix -Wmisleading-indentation warnings (Nick Wellnhofer),
+  Don't touch CFLAGS in configure.ac (Nick Wellnhofer),
+  Ignore function pointer cast warnings (Nick Wellnhofer),
+  Simplify XPath NaN, inf and -0 handling (Nick Wellnhofer),
+  Introduce xmlPosixStrdup and update xmlMemStrdup (Nick Wellnhofer),
+  Add test for ICU flush and pivot buffer (Nick Wellnhofer),
+  Compile testapi with -Wno-unused-function (Nick Wellnhofer)
   
 
 </changes>
index 65839ad..db07ab6 100644 (file)
@@ -8,7 +8,72 @@ H2 {font-family: Verdana,Arial,Helvetica}
 H3 {font-family: Verdana,Arial,Helvetica}
 A:link, A:visited, A:active { text-decoration: underline }
 </style><title>Releases</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Releases</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>The <a href="ChangeLog.html">change log</a> describes the recents commits
-to the <a href="http://git.gnome.org/browse/libxml2/">GIT</a> code base.</p><p>Here is the list of public releases:</p><h3>v2.9.8: Mar 05 2018</h3><ul>
+to the <a href="http://git.gnome.org/browse/libxml2/">GIT</a> code base.</p><p>Here is the list of public releases:</p><h3>v2.9.9: Jan 03 2019</h3><ul>
+  <li>Security:<br />
+  CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick Wellnhofer),<br />
+  CVE-2018-14404 Fix nullptr deref with XPath logic ops (Nick Wellnhofer),<br />
+  </li>
+
+  <li>Documentation:<br />
+  reader: Fix documentation comment (Mohammed Sadiq)<br />
+  </li>
+
+  <li>Portability:<br />
+  Fix MSVC build with lzma (Nick Wellnhofer),<br />
+  Variables need 'extern' in static lib on Cygwin (Michael Haubenwallner),<br />
+  Really declare dllexport/dllimport for Cygwin (Michael Haubenwallner),<br />
+  Merge branch 'patch-2' into 'master' (Nick Wellnhofer),<br />
+  Change dir to $THEDIR after ACLOCAL_PATH check autoreconf creates aclocal.m4 in $srcdir (Vitaly Buka),<br />
+  Improve error message if pkg.m4 couldn't be found (Nick Wellnhofer),<br />
+  NaN and Inf fixes for pre-C99 compilers (Nick Wellnhofer)<br />
+  </li>
+
+  <li>Bug Fixes:<br />
+  Revert "Support xmlTextReaderNextSibling w/o preparsed doc" (Nick Wellnhofer),<br />
+  Fix building relative URIs (Thomas Holder),<br />
+  Problem with data in interleave in RelaxNG validation (Nikolai Weibull),<br />
+  Fix memory leak in xmlSwitchInputEncodingInt error path (Nick Wellnhofer),<br />
+  Set doc on element obtained from freeElems (Nick Wellnhofer),<br />
+  Fix HTML serialization with UTF-8 encoding (Nick Wellnhofer),<br />
+  Use actual doc in xmlTextReaderRead*Xml (Nick Wellnhofer),<br />
+  Unlink node before freeing it in xmlSAX2StartElement (Nick Wellnhofer),<br />
+  Check return value of nodePush in xmlSAX2StartElement (Nick Wellnhofer),<br />
+  Free input buffer in xmlHaltParser (Nick Wellnhofer),<br />
+  Reset HTML parser input pointers on encoding failure (Nick Wellnhofer),<br />
+  Don't run icu_parse_test if EUC-JP is unsupported (Nick Wellnhofer),<br />
+  Fix xmlSchemaValidCtxtPtr reuse memory leak (Greg Hildstrom),<br />
+  Fix xmlTextReaderNext with preparsed document (Felix Bünemann),<br />
+  Remove stray character from comment (Nick Wellnhofer),<br />
+  Remove a misleading line from xmlCharEncOutput (Andrey Bienkowski),<br />
+  HTML noscript should not close p (Daniel Veillard),<br />
+  Don't change context node in xmlXPathRoot (Nick Wellnhofer),<br />
+  Stop using XPATH_OP_RESET (Nick Wellnhofer),<br />
+  Revert "Change calls to xmlCharEncInput to set flush false" (Nick Wellnhofer)<br />
+  </li>
+
+  <li>Improvements:<br />
+  Fix "Problem with data in interleave in RelaxNG validation" (Nikolai Weibull),<br />
+  cleanup: remove some unreachable code (Thomas Holder),<br />
+  add --relative to testURI (Thomas Holder),<br />
+  Remove redefined starts and defines inside include elements (Nikolai Weibull),<br />
+  Allow choice within choice in nameClass in RELAX NG (Nikolai Weibull),<br />
+  Look inside divs for starts and defines inside include (Nikolai Weibull),<br />
+  Add compile and libxml2-config.cmake to .gitignore (Nikolai Weibull),<br />
+  Stop using doc-&gt;charset outside parser code (Nick Wellnhofer),<br />
+  Add newlines to 'xmllint --xpath' output (Nick Wellnhofer),<br />
+  Don't include SAX.h from globals.h (Nick Wellnhofer),<br />
+  Support xmlTextReaderNextSibling w/o preparsed doc (Felix Bünemann),<br />
+  Don't instruct user to run make when autogen.sh failed (林博仁(Buo-ren Lin)),<br />
+  Run Travis ASan tests with "sudo: required" (Nick Wellnhofer),<br />
+  Improve restoring of context size and position (Nick Wellnhofer),<br />
+  Simplify and harden nodeset filtering (Nick Wellnhofer),<br />
+  Avoid unnecessary backups of the context node (Nick Wellnhofer),<br />
+  Fix inconsistency in xmlXPathIsInf (Nick Wellnhofer)<br />
+  </li>
+
+  <li>Cleanups:<br />
+  </li>
+</ul><h3>v2.9.8: Mar 05 2018</h3><ul>
   <li>Portability:<br />
   python: remove single use of _PyVerify_fd (Patrick Welche),<br />
   Build more test executables on Windows/MSVC (Nick Wellnhofer),<br />
index 4059fb7..53388a2 100644 (file)
@@ -709,6 +709,73 @@ to the <a href="http://git.gnome.org/browse/libxml2/">GIT</a> code base.</p>
 
 <p>Here is the list of public releases:</p>
 
+<h3>v2.9.9: Jan 03 2019</h3>
+<ul>
+  <li>Security:<br/>
+  CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick Wellnhofer),<br/>
+  CVE-2018-14404 Fix nullptr deref with XPath logic ops (Nick Wellnhofer),<br/>
+  </li>
+
+  <li>Documentation:<br/>
+  reader: Fix documentation comment (Mohammed Sadiq)<br/>
+  </li>
+
+  <li>Portability:<br/>
+  Fix MSVC build with lzma (Nick Wellnhofer),<br/>
+  Variables need 'extern' in static lib on Cygwin (Michael Haubenwallner),<br/>
+  Really declare dllexport/dllimport for Cygwin (Michael Haubenwallner),<br/>
+  Merge branch 'patch-2' into 'master' (Nick Wellnhofer),<br/>
+  Change dir to $THEDIR after ACLOCAL_PATH check autoreconf creates aclocal.m4 in $srcdir (Vitaly Buka),<br/>
+  Improve error message if pkg.m4 couldn't be found (Nick Wellnhofer),<br/>
+  NaN and Inf fixes for pre-C99 compilers (Nick Wellnhofer)<br/>
+  </li>
+
+  <li>Bug Fixes:<br/>
+  Revert "Support xmlTextReaderNextSibling w/o preparsed doc" (Nick Wellnhofer),<br/>
+  Fix building relative URIs (Thomas Holder),<br/>
+  Problem with data in interleave in RelaxNG validation (Nikolai Weibull),<br/>
+  Fix memory leak in xmlSwitchInputEncodingInt error path (Nick Wellnhofer),<br/>
+  Set doc on element obtained from freeElems (Nick Wellnhofer),<br/>
+  Fix HTML serialization with UTF-8 encoding (Nick Wellnhofer),<br/>
+  Use actual doc in xmlTextReaderRead*Xml (Nick Wellnhofer),<br/>
+  Unlink node before freeing it in xmlSAX2StartElement (Nick Wellnhofer),<br/>
+  Check return value of nodePush in xmlSAX2StartElement (Nick Wellnhofer),<br/>
+  Free input buffer in xmlHaltParser (Nick Wellnhofer),<br/>
+  Reset HTML parser input pointers on encoding failure (Nick Wellnhofer),<br/>
+  Don't run icu_parse_test if EUC-JP is unsupported (Nick Wellnhofer),<br/>
+  Fix xmlSchemaValidCtxtPtr reuse memory leak (Greg Hildstrom),<br/>
+  Fix xmlTextReaderNext with preparsed document (Felix Bünemann),<br/>
+  Remove stray character from comment (Nick Wellnhofer),<br/>
+  Remove a misleading line from xmlCharEncOutput (Andrey Bienkowski),<br/>
+  HTML noscript should not close p (Daniel Veillard),<br/>
+  Don't change context node in xmlXPathRoot (Nick Wellnhofer),<br/>
+  Stop using XPATH_OP_RESET (Nick Wellnhofer),<br/>
+  Revert "Change calls to xmlCharEncInput to set flush false" (Nick Wellnhofer)<br/>
+  </li>
+
+  <li>Improvements:<br/>
+  Fix "Problem with data in interleave in RelaxNG validation" (Nikolai Weibull),<br/>
+  cleanup: remove some unreachable code (Thomas Holder),<br/>
+  add --relative to testURI (Thomas Holder),<br/>
+  Remove redefined starts and defines inside include elements (Nikolai Weibull),<br/>
+  Allow choice within choice in nameClass in RELAX NG (Nikolai Weibull),<br/>
+  Look inside divs for starts and defines inside include (Nikolai Weibull),<br/>
+  Add compile and libxml2-config.cmake to .gitignore (Nikolai Weibull),<br/>
+  Stop using doc-&gt;charset outside parser code (Nick Wellnhofer),<br/>
+  Add newlines to 'xmllint --xpath' output (Nick Wellnhofer),<br/>
+  Don't include SAX.h from globals.h (Nick Wellnhofer),<br/>
+  Support xmlTextReaderNextSibling w/o preparsed doc (Felix Bünemann),<br/>
+  Don't instruct user to run make when autogen.sh failed (林博仁(Buo-ren Lin)),<br/>
+  Run Travis ASan tests with "sudo: required" (Nick Wellnhofer),<br/>
+  Improve restoring of context size and position (Nick Wellnhofer),<br/>
+  Simplify and harden nodeset filtering (Nick Wellnhofer),<br/>
+  Avoid unnecessary backups of the context node (Nick Wellnhofer),<br/>
+  Fix inconsistency in xmlXPathIsInf (Nick Wellnhofer)<br/>
+  </li>
+
+  <li>Cleanups:<br/>
+  </li>
+</ul>
 <h3>v2.9.8: Mar 05 2018</h3>
 <ul>
   <li>Portability:<br/>
index de7b511..a3aaf10 100644 (file)
@@ -2460,8 +2460,6 @@ retry:
         ret = -3;
     }
 
-    if (ret >= 0) output += ret;
-
     /*
      * Attempt to handle error cases
      */
index f933897..1e6b636 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 092a4b2..a300d60 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 98066a8..50aa397 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index a9305aa..5e41b7b 100644 (file)
@@ -17,7 +17,6 @@
 #include <libxml/xmlversion.h>
 #include <libxml/parser.h>
 #include <libxml/xmlerror.h>
-#include <libxml/SAX.h>
 #include <libxml/SAX2.h>
 #include <libxml/xmlmemory.h>
 
index 4a9b3bc..626ed6a 100644 (file)
@@ -575,7 +575,7 @@ struct _xmlDoc {
     void           *ids;        /* Hash table for ID attributes if any */
     void           *refs;       /* Hash table for IDREFs attributes if any */
     const xmlChar  *URL;       /* The URI for that document */
-    int             charset;    /* encoding of the in-memory content
+    int             charset;    /* Internal flag for charset handling,
                                   actually an xmlCharEncoding */
     struct _xmlDict *dict;      /* dict used to allocate names or NULL */
     void           *psvi;      /* for type/PSVI informations */
index 2c79f81..31ab8a1 100644 (file)
   #endif
 #endif
 
-/* Cygwin platform, GNU compiler */
-#if defined(_WIN32) && defined(__CYGWIN__)
+/* Cygwin platform (does not define _WIN32), GNU compiler */
+#if defined(__CYGWIN__)
   #undef XMLPUBFUN
   #undef XMLPUBVAR
   #undef XMLCALL
     #if !defined(LIBXML_STATIC)
       #define XMLPUBVAR __declspec(dllimport) extern
     #else
-      #define XMLPUBVAR
+      #define XMLPUBVAR extern
     #endif
   #endif
   #define XMLCALL __cdecl
index fa7bd9b..8be4ded 100644 (file)
@@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
  *
  * the version string like "1.2.3"
  */
-#define LIBXML_DOTTED_VERSION "2.9.8"
+#define LIBXML_DOTTED_VERSION "2.9.9"
 
 /**
  * LIBXML_VERSION:
  *
  * the version number: 1.2.3 value is 10203
  */
-#define LIBXML_VERSION 20908
+#define LIBXML_VERSION 20909
 
 /**
  * LIBXML_VERSION_STRING:
  *
  * the version number string, 1.2.3 value is "10203"
  */
-#define LIBXML_VERSION_STRING "20908"
+#define LIBXML_VERSION_STRING "20909"
 
 /**
  * LIBXML_VERSION_EXTRA:
  *
  * extra version information, used to show a CVS compilation
  */
-#define LIBXML_VERSION_EXTRA "-GITv2.9.8-rc1-2-gd910e99c3"
+#define LIBXML_VERSION_EXTRA "-GITv2.9.9-rc2-2-g7c4949afa"
 
 /**
  * LIBXML_TEST_VERSION:
@@ -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(20908);
+#define LIBXML_TEST_VERSION xmlCheckVersion(20909);
 
 #ifndef VMS
 #if 0
index 0b0fdcb..0360b79 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2016-01-11.22; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -496,6 +496,6 @@ done
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index 1460904..4caa25a 100644 (file)
@@ -2,7 +2,7 @@
 
 Summary: Library providing XML and HTML support
 Name: libxml2
-Version: 2.9.8
+Version: 2.9.9
 Release: 1%{?dist}%{?extra_release}
 License: MIT
 Group: Development/Libraries
@@ -203,6 +203,6 @@ rm -fr %{buildroot}
 %endif # with_python3
 
 %changelog
-* Mon Mar  5 2018 Daniel Veillard <veillard@redhat.com>
-- upstream release 2.9.8 see http://xmlsoft.org/news.html
+* Thu Jan  3 2019 Daniel Veillard <veillard@redhat.com>
+- upstream release 2.9.9 see http://xmlsoft.org/news.html
 
index 370dcf1..9889cb2 100644 (file)
@@ -2279,3 +2279,10 @@ LIBXML2_2.9.1 {
   xmlXPathSetContextNode;
 } LIBXML2_2.9.0;
 
+LIBXML2_2.9.8 {
+    global:
+
+# hash
+  xmlHashDefaultDeallocator;
+} LIBXML2_2.9.1;
+
index 0f0a2da..30be9c8 100644 (file)
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -7272,10 +7272,12 @@ func_mode_link ()
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
       # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -specs=*             GCC specs files
       # -stdlib=*            select c++ std lib with clang
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+      -specs=*)
         func_quote_for_eval "$arg"
        arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
diff --git a/missing b/missing
index f62bbae..b7e571e 100755 (executable)
--- a/missing
+++ b/missing
@@ -1,9 +1,9 @@
-#! /bin/sh
+#!/bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -210,6 +210,6 @@ exit $st
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index ca9fde2..5813a66 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
            ctxt->input->free((xmlChar *) ctxt->input->base);
            ctxt->input->free = NULL;
        }
+        if (ctxt->input->buf != NULL) {
+            xmlFreeParserInputBuffer(ctxt->input->buf);
+            ctxt->input->buf = NULL;
+        }
        ctxt->input->cur = BAD_CAST"";
+        ctxt->input->length = 0;
        ctxt->input->base = ctxt->input->cur;
         ctxt->input->end = ctxt->input->cur;
     }
index 8c0cd57..0f015de 100644 (file)
@@ -1214,7 +1214,7 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
                 /*
                  * convert as much as possible of the buffer
                  */
-                nbchars = xmlCharEncInput(input->buf, 0);
+                nbchars = xmlCharEncInput(input->buf, 1);
             } else {
                 /*
                  * convert just enough to get
@@ -1240,8 +1240,18 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
         * size to be able to convert the buffer.
         */
        xmlErrInternal(ctxt, "switching encoding : no input\n", NULL);
+        /*
+         * Callers assume that the input buffer takes ownership of the
+         * encoding handler. xmlCharEncCloseFunc frees unregistered
+         * handlers and avoids a memory leak.
+         */
+        xmlCharEncCloseFunc(handler);
        return (-1);
     }
+    /*
+     * We should actually raise an error here, see issue #34.
+     */
+    xmlCharEncCloseFunc(handler);
     return (0);
 }
 
index 389a9f0..3f6eb46 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index c971840..f03f922 100755 (executable)
@@ -226,7 +226,7 @@ else:
 setup (name = "libxml2-python",
        # On *nix, the version number is created from setup.py.in
        # On windows, it is set by configure.js
-       version = "2.9.8",
+       version = "2.9.9",
        description = descr,
        author = "Daniel Veillard",
        author_email = "veillard@redhat.com",
index a45b8e2..8119c1c 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 88d351d..914706a 100644 (file)
--- a/relaxng.c
+++ b/relaxng.c
@@ -1573,6 +1573,9 @@ xmlRelaxNGRemoveRedefine(xmlRelaxNGParserCtxtPtr ctxt,
 #endif
                 }
             }
+            if (xmlRelaxNGRemoveRedefine(ctxt, URL, tmp->children, name) == 1) {
+                found = 1;
+            }
         }
         tmp = tmp2;
     }
@@ -1739,7 +1742,18 @@ xmlRelaxNGLoadInclude(xmlRelaxNGParserCtxtPtr ctxt, const xmlChar * URL,
                 xmlFree(name);
             }
         }
-        cur = cur->next;
+        if (IS_RELAXNG(cur, "div") && cur->children != NULL) {
+            cur = cur->children;
+        } else {
+            if (cur->next != NULL) {
+                cur = cur->next;
+            } else {
+                while (cur->parent != node && cur->parent->next == NULL) {
+                    cur = cur->parent;
+                }
+                cur = cur->parent != node ? cur->parent->next : NULL;
+            }
+        }
     }
 
 
@@ -3979,7 +3993,7 @@ xmlRelaxNGGenerateAttributes(xmlRelaxNGParserCtxtPtr ctxt,
  * xmlRelaxNGGetElements:
  * @ctxt:  a Relax-NG parser context
  * @def:  the definition definition
- * @eora:  gather elements (0) or attributes (1)
+ * @eora:  gather elements (0), attributes (1) or elements and text (2)
  *
  * Compute the list of top elements a definition can generate
  *
@@ -4005,7 +4019,12 @@ xmlRelaxNGGetElements(xmlRelaxNGParserCtxtPtr ctxt,
     while (cur != NULL) {
         if (((eora == 0) && ((cur->type == XML_RELAXNG_ELEMENT) ||
                              (cur->type == XML_RELAXNG_TEXT))) ||
-            ((eora == 1) && (cur->type == XML_RELAXNG_ATTRIBUTE))) {
+            ((eora == 1) && (cur->type == XML_RELAXNG_ATTRIBUTE)) ||
+            ((eora == 2) && ((cur->type == XML_RELAXNG_DATATYPE) ||
+                            (cur->type == XML_RELAXNG_ELEMENT) ||
+                            (cur->type == XML_RELAXNG_LIST) ||
+                             (cur->type == XML_RELAXNG_TEXT) ||
+                            (cur->type == XML_RELAXNG_VALUE)))) {
             if (ret == NULL) {
                 max = 10;
                 ret = (xmlRelaxNGDefinePtr *)
@@ -4360,7 +4379,7 @@ xmlRelaxNGComputeInterleaves(void *payload, void *data,
         if (cur->type == XML_RELAXNG_TEXT)
             is_mixed++;
         groups[nbgroups]->rule = cur;
-        groups[nbgroups]->defs = xmlRelaxNGGetElements(ctxt, cur, 0);
+        groups[nbgroups]->defs = xmlRelaxNGGetElements(ctxt, cur, 2);
         groups[nbgroups]->attrs = xmlRelaxNGGetElements(ctxt, cur, 1);
         nbgroups++;
         cur = cur->next;
@@ -5347,11 +5366,15 @@ xmlRelaxNGParseNameClass(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node,
         xmlNodePtr child;
         xmlRelaxNGDefinePtr last = NULL;
 
-        ret = xmlRelaxNGNewDefine(ctxt, node);
-        if (ret == NULL)
-            return (NULL);
-        ret->parent = def;
-        ret->type = XML_RELAXNG_CHOICE;
+        if (def->type == XML_RELAXNG_CHOICE) {
+            ret = def;
+        } else {
+            ret = xmlRelaxNGNewDefine(ctxt, node);
+            if (ret == NULL)
+                return (NULL);
+            ret->parent = def;
+            ret->type = XML_RELAXNG_CHOICE;
+        }
 
         if (node->children == NULL) {
             xmlRngPErr(ctxt, node, XML_RNGP_CHOICE_EMPTY,
@@ -5363,7 +5386,7 @@ xmlRelaxNGParseNameClass(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node,
                 tmp = xmlRelaxNGParseNameClass(ctxt, child, ret);
                 if (tmp != NULL) {
                     if (last == NULL) {
-                        last = ret->nameClass = tmp;
+                        last = tmp;
                     } else {
                         last->next = tmp;
                         last = tmp;
@@ -9262,7 +9285,10 @@ xmlRelaxNGNodeMatchesList(xmlNodePtr node, xmlRelaxNGDefinePtr * list)
                 return (1);
         } else if (((node->type == XML_TEXT_NODE) ||
                     (node->type == XML_CDATA_SECTION_NODE)) &&
-                   (cur->type == XML_RELAXNG_TEXT)) {
+                   ((cur->type == XML_RELAXNG_DATATYPE) ||
+                   (cur->type == XML_RELAXNG_LIST) ||
+                    (cur->type == XML_RELAXNG_TEXT) ||
+                    (cur->type == XML_RELAXNG_VALUE))) {
             return (1);
         }
         cur = list[i++];
index 554039f..38ef5c4 100644 (file)
@@ -21,14 +21,11 @@ Entity: line 1:
             ^
 ./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
 
-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
-     ^
+
+^
 ./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated
-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
-     ^
-./test/errors/759573.xml:1: parser error : StartTag: invalid element name
-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
-      ^
-./test/errors/759573.xml:1: parser error : Extra content at the end of the document
-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
-      ^
+
+^
+./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found
+
+^
diff --git a/result/relaxng/anyName0_0 b/result/relaxng/anyName0_0
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/relaxng/anyName0_0.err b/result/relaxng/anyName0_0.err
new file mode 100644 (file)
index 0000000..f660c26
--- /dev/null
@@ -0,0 +1 @@
+./test/relaxng/anyName0_0.xml validates
diff --git a/result/relaxng/anyName0_err b/result/relaxng/anyName0_err
new file mode 100644 (file)
index 0000000..ab6f08d
--- /dev/null
@@ -0,0 +1 @@
+./test/relaxng/anyName0.rng validates
diff --git a/result/relaxng/anyName0_valid b/result/relaxng/anyName0_valid
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/relaxng/include0_0 b/result/relaxng/include0_0
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/relaxng/include0_0.err b/result/relaxng/include0_0.err
new file mode 100644 (file)
index 0000000..24013bc
--- /dev/null
@@ -0,0 +1 @@
+./test/relaxng/include0_0.xml validates
diff --git a/result/relaxng/include0_err b/result/relaxng/include0_err
new file mode 100644 (file)
index 0000000..cd16cbe
--- /dev/null
@@ -0,0 +1 @@
+./test/relaxng/include0.rng validates
diff --git a/result/relaxng/include0_valid b/result/relaxng/include0_valid
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/relaxng/include1_0 b/result/relaxng/include1_0
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/relaxng/include1_0.err b/result/relaxng/include1_0.err
new file mode 100644 (file)
index 0000000..8c13f4c
--- /dev/null
@@ -0,0 +1 @@
+./test/relaxng/include1_0.xml validates
diff --git a/result/relaxng/include1_err b/result/relaxng/include1_err
new file mode 100644 (file)
index 0000000..ad4850b
--- /dev/null
@@ -0,0 +1 @@
+./test/relaxng/include1.rng validates
diff --git a/result/relaxng/include1_valid b/result/relaxng/include1_valid
new file mode 100644 (file)
index 0000000..e69de29
index 605c1d1..addda5c 100644 (file)
--- a/runtest.c
+++ b/runtest.c
@@ -4413,9 +4413,10 @@ launchTests(testDescPtr tst) {
     char *result;
     char *error;
     int mem;
-    xmlCharEncodingHandlerPtr ebcdicHandler;
+    xmlCharEncodingHandlerPtr ebcdicHandler, eucJpHandler;
 
     ebcdicHandler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_EBCDIC);
+    eucJpHandler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_EUC_JP);
 
     if (tst == NULL) return(-1);
     if (tst->in != NULL) {
@@ -4426,8 +4427,10 @@ launchTests(testDescPtr tst) {
        for (i = 0;i < globbuf.gl_pathc;i++) {
            if (!checkTestFile(globbuf.gl_pathv[i]))
                continue;
-            if ((ebcdicHandler == NULL) &&
-                (strstr(globbuf.gl_pathv[i], "ebcdic") != NULL))
+            if (((ebcdicHandler == NULL) &&
+                 (strstr(globbuf.gl_pathv[i], "ebcdic") != NULL)) ||
+                ((eucJpHandler == NULL) &&
+                 (strstr(globbuf.gl_pathv[i], "icu_parse_test") != NULL)))
                 continue;
            if (tst->suffix != NULL) {
                result = resultFilename(globbuf.gl_pathv[i], tst->out,
@@ -4496,6 +4499,7 @@ launchTests(testDescPtr tst) {
     }
 
     xmlCharEncCloseFunc(ebcdicHandler);
+    xmlCharEncCloseFunc(eucJpHandler);
 
     return(err);
 }
diff --git a/test/relaxng/anyName0.rng b/test/relaxng/anyName0.rng
new file mode 100644 (file)
index 0000000..9fc5ead
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <element>
+      <choice>
+        <choice>
+          <name>a</name>
+          <name>b</name>
+        </choice>
+        <name>c</name>
+      </choice>
+      <empty/>
+    </element>
+  </start>
+</grammar>
diff --git a/test/relaxng/anyName0_0.xml b/test/relaxng/anyName0_0.xml
new file mode 100644 (file)
index 0000000..fb08e36
--- /dev/null
@@ -0,0 +1 @@
+<b/>
diff --git a/test/relaxng/include0.inc b/test/relaxng/include0.inc
new file mode 100644 (file)
index 0000000..8636ee4
--- /dev/null
@@ -0,0 +1,5 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <start>
+    <notAllowed/>
+  </start>
+</grammar>
diff --git a/test/relaxng/include0.rng b/test/relaxng/include0.rng
new file mode 100644 (file)
index 0000000..e8edb92
--- /dev/null
@@ -0,0 +1,11 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <include href="include0.inc">
+    <div>
+      <start>
+        <element name="root">
+          <empty/>
+        </element>
+      </start>
+    </div>
+  </include>
+</grammar>
diff --git a/test/relaxng/include0_0.xml b/test/relaxng/include0_0.xml
new file mode 100644 (file)
index 0000000..f3f286e
--- /dev/null
@@ -0,0 +1 @@
+<root/>
diff --git a/test/relaxng/include1-0.inc b/test/relaxng/include1-0.inc
new file mode 100644 (file)
index 0000000..87c6802
--- /dev/null
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+ <include href="include1-1.inc">
+   <start>
+     <notAllowed/>
+   </start>
+ </include>
+ <start combine="choice">
+   <element name="b">
+     <empty/>
+   </element>
+ </start>
+</grammar>
diff --git a/test/relaxng/include1-1.inc b/test/relaxng/include1-1.inc
new file mode 100644 (file)
index 0000000..8af51ec
--- /dev/null
@@ -0,0 +1,7 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+ <start>
+   <element name="c">
+     <empty/>
+   </element>
+ </start>
+</grammar>
diff --git a/test/relaxng/include1.rng b/test/relaxng/include1.rng
new file mode 100644 (file)
index 0000000..c36bff9
--- /dev/null
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+ <include href="include1-0.inc">
+   <start>
+     <notAllowed/>
+   </start>
+ </include>
+ <start combine="choice">
+   <element name="a">
+     <empty/>
+   </element>
+ </start>
+</grammar>
diff --git a/test/relaxng/include1_0.xml b/test/relaxng/include1_0.xml
new file mode 100644 (file)
index 0000000..d80a5e2
--- /dev/null
@@ -0,0 +1 @@
+<a/>
index d20989d..0043b20 100644 (file)
--- a/testURI.c
+++ b/testURI.c
@@ -19,6 +19,7 @@
 static const char *base = NULL;
 static int escape = 0;
 static int debug = 0;
+static int relative = 0;
 
 static void handleURI(const char *str) {
     int ret;
@@ -57,7 +58,12 @@ static void handleURI(const char *str) {
            }
        }
     } else {
-       res = xmlBuildURI((xmlChar *)str, (xmlChar *) base);
+       if (relative) {
+           res = xmlBuildRelativeURI((xmlChar *)str, (xmlChar *) base);
+       } else {
+           res = xmlBuildURI((xmlChar *)str, (xmlChar *) base);
+       }
+
        if (res != NULL) {
            printf("%s\n", (char *) res);
        }
@@ -75,6 +81,11 @@ int main(int argc, char **argv) {
     int i, arg = 1;
 
     if ((argc > arg) && (argv[arg] != NULL) &&
+       (!strcmp(argv[arg], "--relative"))) {
+       arg++;
+       relative++;
+    }
+    if ((argc > arg) && (argv[arg] != NULL) &&
        ((!strcmp(argv[arg], "-base")) || (!strcmp(argv[arg], "--base")))) {
        arg++;
        base = argv[arg];
index fe42a37..4a751e2 100644 (file)
--- a/testapi.c
+++ b/testapi.c
@@ -9989,6 +9989,43 @@ test_xmlHashCreateDict(void) {
 
 
 static int
+test_xmlHashDefaultDeallocator(void) {
+    int test_ret = 0;
+
+    int mem_base;
+    void * entry; /* the hash table entry */
+    int n_entry;
+    xmlChar * name; /* the entry's name */
+    int n_name;
+
+    for (n_entry = 0;n_entry < gen_nb_void_ptr;n_entry++) {
+    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+        mem_base = xmlMemBlocks();
+        entry = gen_void_ptr(n_entry, 0);
+        name = gen_const_xmlChar_ptr(n_name, 1);
+
+        xmlHashDefaultDeallocator(entry, (const xmlChar *)name);
+        call_tests++;
+        des_void_ptr(n_entry, entry, 0);
+        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
+        xmlResetLastError();
+        if (mem_base != xmlMemBlocks()) {
+            printf("Leak of %d blocks found in xmlHashDefaultDeallocator",
+                  xmlMemBlocks() - mem_base);
+           test_ret++;
+            printf(" %d", n_entry);
+            printf(" %d", n_name);
+            printf("\n");
+        }
+    }
+    }
+    function_tests++;
+
+    return(test_ret);
+}
+
+
+static int
 test_xmlHashLookup(void) {
     int test_ret = 0;
 
@@ -10720,13 +10757,14 @@ static int
 test_hash(void) {
     int test_ret = 0;
 
-    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
+    if (quiet == 0) printf("Testing hash : 17 of 25 functions ...\n");
     test_ret += test_xmlHashAddEntry();
     test_ret += test_xmlHashAddEntry2();
     test_ret += test_xmlHashAddEntry3();
     test_ret += test_xmlHashCopy();
     test_ret += test_xmlHashCreate();
     test_ret += test_xmlHashCreateDict();
+    test_ret += test_xmlHashDefaultDeallocator();
     test_ret += test_xmlHashLookup();
     test_ret += test_xmlHashLookup2();
     test_ret += test_xmlHashLookup3();
diff --git a/uri.c b/uri.c
index 84e420a..2cf8d9f 100644 (file)
--- a/uri.c
+++ b/uri.c
@@ -2236,25 +2236,8 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base)
      * First we take care of the special case where either of the
      * two path components may be missing (bug 316224)
      */
-    if (bas->path == NULL) {
-       if (ref->path != NULL) {
-           uptr = (xmlChar *) ref->path;
-           if (*uptr == '/')
-               uptr++;
-           /* exception characters from xmlSaveUri */
-           val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
-       }
-       goto done;
-    }
     bptr = (xmlChar *)bas->path;
-    if (ref->path == NULL) {
-       for (ix = 0; bptr[ix] != 0; ix++) {
-           if (bptr[ix] == '/')
-               nbslash++;
-       }
-       uptr = NULL;
-       len = 1;        /* this is for a string terminator only */
-    } else {
+    {
         xmlChar *rptr = (xmlChar *) ref->path;
         int pos = 0;
 
@@ -2280,30 +2263,28 @@ xmlBuildRelativeURI (const xmlChar * URI, const xmlChar * base)
         * beginning of the "unique" suffix of URI
         */
        ix = pos;
-       if ((rptr[ix] == '/') && (ix > 0))
-           ix--;
-       else if ((rptr[ix] == 0) && (ix > 1) && (rptr[ix - 1] == '/'))
-           ix -= 2;
        for (; ix > 0; ix--) {
-           if (rptr[ix] == '/')
+           if (rptr[ix - 1] == '/')
                break;
        }
-       if (ix == 0) {
-           uptr = (xmlChar *)rptr;
-       } else {
-           ix++;
-           uptr = (xmlChar *)&rptr[ix];
-       }
+       uptr = (xmlChar *)&rptr[ix];
 
        /*
         * In base, count the number of '/' from the differing point
         */
-       if (bptr[pos] != rptr[pos]) {/* check for trivial URI == base */
-           for (; bptr[ix] != 0; ix++) {
-               if (bptr[ix] == '/')
-                   nbslash++;
-           }
+       for (; bptr[ix] != 0; ix++) {
+           if (bptr[ix] == '/')
+               nbslash++;
        }
+
+       /*
+        * e.g: URI="foo/" base="foo/bar" -> "./"
+        */
+       if (nbslash == 0 && !uptr[0]) {
+           val = xmlStrdup(BAD_CAST "./");
+           goto done;
+       }
+
        len = xmlStrlen (uptr) + 1;
     }
 
index 491dc88..ee4250a 100644 (file)
@@ -244,6 +244,12 @@ XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\buf.obj\
        $(XML_INTDIR_A_DLL)\xpointer.obj\
        $(XML_INTDIR_A_DLL)\xmlstring.obj
 
+!if "$(WITH_LZMA)" == "1"
+XML_OBJS = $(XML_OBJS) $(XML_INTDIR)\xzlib.obj
+XML_OBJS_A = $(XML_OBJS_A) $(XML_INTDIR_A)\xzlib.obj
+XML_OBJS_A_DLL = $(XML_OBJS_A_DLL) $(XML_INTDIR_A_DLL)\xzlib.obj
+!endif
+
 # Xmllint and friends executables.
 UTILS = $(BINDIR)\xmllint.exe\
        $(BINDIR)\xmlcatalog.exe\
diff --git a/xmlIO.c b/xmlIO.c
index 8254347..f61dd05 100644 (file)
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -3157,7 +3157,7 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in,
         * convert as much as possible to the parser reading buffer.
         */
        use = xmlBufUse(in->raw);
-       nbchars = xmlCharEncInput(in, 0);
+       nbchars = xmlCharEncInput(in, 1);
        if (nbchars < 0) {
            xmlIOErr(XML_IO_ENCODER, NULL);
            in->error = XML_IO_ENCODER;
@@ -3273,7 +3273,7 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
         * convert as much as possible to the parser reading buffer.
         */
        use = xmlBufUse(in->raw);
-       nbchars = xmlCharEncInput(in, 0);
+       nbchars = xmlCharEncInput(in, 1);
        if (nbchars < 0) {
            xmlIOErr(XML_IO_ENCODER, NULL);
            in->error = XML_IO_ENCODER;
index 6512540..d6f5eb0 100644 (file)
--- a/xmllint.c
+++ b/xmllint.c
@@ -2071,51 +2071,52 @@ static void doXPathDump(xmlXPathObjectPtr cur) {
             int i;
             xmlNodePtr node;
 #ifdef LIBXML_OUTPUT_ENABLED
-            xmlSaveCtxtPtr ctxt;
+            xmlOutputBufferPtr buf;
 
             if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr <= 0)) {
                 fprintf(stderr, "XPath set is empty\n");
                 progresult = XMLLINT_ERR_XPATH;
                 break;
             }
-            ctxt = xmlSaveToFd(1, NULL, 0);
-            if (ctxt == NULL) {
+            buf = xmlOutputBufferCreateFile(stdout, NULL);
+            if (buf == NULL) {
                 fprintf(stderr, "Out of memory for XPath\n");
                 progresult = XMLLINT_ERR_MEM;
                 return;
             }
             for (i = 0;i < cur->nodesetval->nodeNr;i++) {
                 node = cur->nodesetval->nodeTab[i];
-                xmlSaveTree(ctxt, node);
+                xmlNodeDumpOutput(buf, node->doc, node, 0, 0, NULL);
+                xmlOutputBufferWrite(buf, 1, "\n");
             }
-            xmlSaveClose(ctxt);
+            xmlOutputBufferClose(buf);
 #else
             printf("xpath returned %d nodes\n", cur->nodesetval->nodeNr);
 #endif
            break;
         }
         case XPATH_BOOLEAN:
-           if (cur->boolval) printf("true");
-           else printf("false");
+           if (cur->boolval) printf("true\n");
+           else printf("false\n");
            break;
         case XPATH_NUMBER:
            switch (xmlXPathIsInf(cur->floatval)) {
            case 1:
-               printf("Infinity");
+               printf("Infinity\n");
                break;
            case -1:
-               printf("-Infinity");
+               printf("-Infinity\n");
                break;
            default:
                if (xmlXPathIsNaN(cur->floatval)) {
-                   printf("NaN");
+                   printf("NaN\n");
                } else {
-                   printf("%0g", cur->floatval);
+                   printf("%0g\n", cur->floatval);
                }
            }
            break;
         case XPATH_STRING:
-           printf("%s", (const char *) cur->stringval);
+           printf("%s\n", (const char *) cur->stringval);
            break;
         case XPATH_UNDEFINED:
            fprintf(stderr, "XPath Object is uninitialized\n");
index 4053269..db310c8 100644 (file)
@@ -1711,10 +1711,11 @@ xmlTextReaderReadInnerXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED)
     if (xmlTextReaderExpand(reader) == NULL) {
         return NULL;
     }
-    doc = reader->doc;
+    doc = reader->node->doc;
     buff = xmlBufferCreate();
     for (cur_node = reader->node->children; cur_node != NULL;
          cur_node = cur_node->next) {
+        /* XXX: Why is the node copied? */
         node = xmlDocCopyNode(cur_node, doc, 1);
         buff2 = xmlBufferCreate();
         if (xmlNodeDump(buff2, doc, node, 0, 0) == -1) {
@@ -1755,10 +1756,11 @@ xmlTextReaderReadOuterXml(xmlTextReaderPtr reader ATTRIBUTE_UNUSED)
     xmlDocPtr doc;
 
     node = reader->node;
-    doc = reader->doc;
+    doc = node->doc;
     if (xmlTextReaderExpand(reader) == NULL) {
         return NULL;
     }
+    /* XXX: Why is the node copied? */
        if (node->type == XML_DTD_NODE) {
                node = (xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node);
        } else {
@@ -1917,12 +1919,9 @@ xmlTextReaderNextTree(xmlTextReaderPtr reader)
 
        /* if reader->node->next is NULL mean no subtree for current node,
        so need to move to sibling of parent node if present */
-        if ((reader->node->type == XML_ELEMENT_NODE) ||
-            (reader->node->type == XML_ATTRIBUTE_NODE)) {
-            reader->state = XML_TEXTREADER_BACKTRACK;
-           /* This will move to parent if present */
-            xmlTextReaderRead(reader);
-        }
+       reader->state = XML_TEXTREADER_BACKTRACK;
+       /* This will move to parent if present */
+       xmlTextReaderRead(reader);
     }
 
     if (reader->node->next != 0) {
@@ -3006,7 +3005,7 @@ xmlTextReaderAttributeCount(xmlTextReaderPtr reader) {
  * Reference:
  * http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/XmlNodeType.html
  *
- * Returns the xmlNodeType of the current node or -1 in case of error
+ * Returns the xmlReaderTypes of the current node or -1 in case of error
  */
 int
 xmlTextReaderNodeType(xmlTextReaderPtr reader) {
index 6c7418e..7a05d83 100644 (file)
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -1123,9 +1123,6 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) {
         cur->encoding = BAD_CAST ctxt->encoding;
     } else if (cur->encoding != NULL) {
        encoding = cur->encoding;
-    } else if (cur->charset != XML_CHAR_ENCODING_UTF8) {
-       encoding = (const xmlChar *)
-                    xmlGetCharEncodingName((xmlCharEncoding) cur->charset);
     }
 
     if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
index 405f72a..019988a 100644 (file)
@@ -27653,6 +27653,17 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
        vctxt->nbIdcNodes = 0;
        vctxt->sizeIdcNodes = 0;
     }
+
+    if (vctxt->idcKeys != NULL) {
+       int i;
+       for (i = 0; i < vctxt->nbIdcKeys; i++)
+           xmlSchemaIDCFreeKey(vctxt->idcKeys[i]);
+       xmlFree(vctxt->idcKeys);
+       vctxt->idcKeys = NULL;
+       vctxt->nbIdcKeys = 0;
+       vctxt->sizeIdcKeys = 0;
+    }
+
     /*
     * Note that we won't delete the XPath state pool here.
     */
diff --git a/xpath.c b/xpath.c
index f440696..5e3bb9f 100644 (file)
--- a/xpath.c
+++ b/xpath.c
@@ -2,7 +2,7 @@
  * xpath.c: XML Path Language implementation
  *          XPath is a language for addressing parts of an XML document,
  *          designed to be used by both XSLT and XPointer
- *f
+ *
  * Reference: W3C Recommendation 16 November 1999
  *     http://www.w3.org/TR/1999/REC-xpath-19991116
  * Public reference:
@@ -477,27 +477,28 @@ int wrap_cmp( xmlNodePtr x, xmlNodePtr y );
  *                                                                     *
  ************************************************************************/
 
-#ifndef NAN
-#define NAN (0.0 / 0.0)
+#ifndef INFINITY
+#define INFINITY (DBL_MAX * DBL_MAX)
 #endif
 
-#ifndef INFINITY
-#define INFINITY HUGE_VAL
+#ifndef NAN
+#define NAN (INFINITY / INFINITY)
 #endif
 
-double xmlXPathNAN = NAN;
-double xmlXPathPINF = INFINITY;
-double xmlXPathNINF = -INFINITY;
+double xmlXPathNAN;
+double xmlXPathPINF;
+double xmlXPathNINF;
 
 /**
  * xmlXPathInit:
  *
  * Initialize the XPath environment
- *
- * Does nothing but must be kept as public function.
  */
 void
 xmlXPathInit(void) {
+    xmlXPathNAN = NAN;
+    xmlXPathPINF = INFINITY;
+    xmlXPathNINF = -INFINITY;
 }
 
 /**
@@ -526,9 +527,9 @@ xmlXPathIsInf(double val) {
 #ifdef isinf
     return isinf(val) ? (val > 0 ? 1 : -1) : 0;
 #else
-    if (val >= HUGE_VAL)
+    if (val >= INFINITY)
         return 1;
-    if (val <= -HUGE_VAL)
+    if (val <= -INFINITY)
         return -1;
     return 0;
 #endif
@@ -867,15 +868,14 @@ typedef enum {
     XPATH_OP_UNION,
     XPATH_OP_ROOT,
     XPATH_OP_NODE,
-    XPATH_OP_RESET, /* 10 */
     XPATH_OP_COLLECT,
-    XPATH_OP_VALUE, /* 12 */
+    XPATH_OP_VALUE, /* 11 */
     XPATH_OP_VARIABLE,
     XPATH_OP_FUNCTION,
     XPATH_OP_ARG,
     XPATH_OP_PREDICATE,
-    XPATH_OP_FILTER, /* 17 */
-    XPATH_OP_SORT /* 18 */
+    XPATH_OP_FILTER, /* 16 */
+    XPATH_OP_SORT /* 17 */
 #ifdef LIBXML_XPTR_ENABLED
     ,XPATH_OP_RANGETO
 #endif
@@ -1525,8 +1525,6 @@ xmlXPathDebugDumpStepOp(FILE *output, xmlXPathCompExprPtr comp,
             fprintf(output, "ROOT"); break;
         case XPATH_OP_NODE:
             fprintf(output, "NODE"); break;
-        case XPATH_OP_RESET:
-            fprintf(output, "RESET"); break;
         case XPATH_OP_SORT:
             fprintf(output, "SORT"); break;
         case XPATH_OP_COLLECT: {
@@ -8479,9 +8477,8 @@ void
 xmlXPathRoot(xmlXPathParserContextPtr ctxt) {
     if ((ctxt == NULL) || (ctxt->context == NULL))
        return;
-    ctxt->context->node = (xmlNodePtr) ctxt->context->doc;
     valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context,
-       ctxt->context->node));
+       (xmlNodePtr) ctxt->context->doc));
 }
 
 /************************************************************************
@@ -10734,7 +10731,6 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 
            PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
                    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
-           PUSH_UNARY_EXPR(XPATH_OP_RESET, ctxt->comp->last, 1, 0);
 
            xmlXPathCompRelativeLocationPath(ctxt);
        } else if (CUR == '/') {
@@ -11665,6 +11661,7 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
        xmlXPathContextPtr xpctxt = ctxt->context;
        xmlNodePtr contextNode, oldContextNode;
        xmlDocPtr oldContextDoc;
+        int oldcs, oldpp;
        int i, res, contextPos = 0, newContextSize;
        xmlXPathStepOpPtr exprOp;
        xmlXPathObjectPtr contextObj = NULL, exprRes = NULL;
@@ -11701,6 +11698,8 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
        */
        oldContextNode = xpctxt->node;
        oldContextDoc = xpctxt->doc;
+        oldcs = xpctxt->contextSize;
+        oldpp = xpctxt->proximityPosition;
        /*
        * Get the expression of this predicate.
        */
@@ -11787,8 +11786,8 @@ evaluation_exit:
        */
        xpctxt->node = oldContextNode;
        xpctxt->doc = oldContextDoc;
-       xpctxt->contextSize = -1;
-       xpctxt->proximityPosition = -1;
+       xpctxt->contextSize = oldcs;
+       xpctxt->proximityPosition = oldpp;
        return(newContextSize);
     }
     return(contextSize);
@@ -11831,6 +11830,7 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
        return (contextSize);
     } else {
        xmlDocPtr oldContextDoc;
+        int oldcs, oldpp;
        int i, pos = 0, newContextSize = 0, contextPos = 0, res;
        xmlXPathStepOpPtr exprOp;
        xmlXPathObjectPtr contextObj = NULL, exprRes = NULL;
@@ -11851,6 +11851,8 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
        */
        oldContextNode = xpctxt->node;
        oldContextDoc = xpctxt->doc;
+        oldcs = xpctxt->contextSize;
+        oldpp = xpctxt->proximityPosition;
        /*
        * Get the expression of this predicate.
        */
@@ -11987,8 +11989,8 @@ evaluation_exit:
        */
        xpctxt->node = oldContextNode;
        xpctxt->doc = oldContextDoc;
-       xpctxt->contextSize = -1;
-       xpctxt->proximityPosition = -1;
+       xpctxt->contextSize = oldcs;
+       xpctxt->proximityPosition = oldpp;
        return(newContextSize);
     }
     return(contextSize);
@@ -12778,15 +12780,6 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt,
            valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context,
                ctxt->context->node));
             return (total);
-        case XPATH_OP_RESET:
-            if (op->ch1 != -1)
-                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
-           CHECK_ERROR0;
-            if (op->ch2 != -1)
-                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
-           CHECK_ERROR0;
-            ctxt->context->node = NULL;
-            return (total);
         case XPATH_OP_COLLECT:{
                 if (op->ch1 == -1)
                     return (total);
@@ -12842,10 +12835,6 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
     int total = 0, cur;
     xmlXPathCompExprPtr comp;
     xmlXPathObjectPtr arg1, arg2;
-    xmlNodePtr bak;
-    xmlDocPtr bakd;
-    int pp;
-    int cs;
 
     CHECK_ERROR0;
     comp = ctxt->comp;
@@ -12853,10 +12842,6 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
         case XPATH_OP_END:
             return (0);
         case XPATH_OP_UNION:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total =
                 xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
            CHECK_ERROR0;
@@ -12874,10 +12859,6 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
                                                      nodesetval->nodeNr -
                                                      1];
             }
-           ctxt->context->doc = bakd;
-           ctxt->context->node = bak;
-           ctxt->context->proximityPosition = pp;
-           ctxt->context->contextSize = cs;
             cur =
                 xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
            CHECK_ERROR0;
@@ -12917,15 +12898,6 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
            valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context,
                ctxt->context->node));
             return (total);
-        case XPATH_OP_RESET:
-            if (op->ch1 != -1)
-                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
-           CHECK_ERROR0;
-            if (op->ch2 != -1)
-                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
-           CHECK_ERROR0;
-            ctxt->context->node = NULL;
-            return (total);
         case XPATH_OP_COLLECT:{
                 if (op->ch1 == -1)
                     return (0);
@@ -12970,6 +12942,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
     xmlNodeSetPtr oldset;
     xmlNodePtr oldnode;
     xmlDocPtr oldDoc;
+    int oldcs, oldpp;
     int i;
 
     CHECK_ERROR0;
@@ -13021,7 +12994,6 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
        return (total);
 
 #ifdef LIBXML_XPTR_ENABLED
-    oldnode = ctxt->context->node;
     /*
     * Hum are we filtering the result of an XPointer expression
     */
@@ -13036,23 +13008,17 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
        * up a new locset.
        */
        CHECK_TYPE0(XPATH_LOCATIONSET);
+
+       if ((ctxt->value->user == NULL) ||
+            (((xmlLocationSetPtr) ctxt->value->user)->locNr == 0))
+           return (total);
+
        obj = valuePop(ctxt);
        oldlocset = obj->user;
-       ctxt->context->node = NULL;
+        oldnode = ctxt->context->node;
+        oldcs = ctxt->context->contextSize;
+        oldpp = ctxt->context->proximityPosition;
 
-       if ((oldlocset == NULL) || (oldlocset->locNr == 0)) {
-           ctxt->context->contextSize = 0;
-           ctxt->context->proximityPosition = 0;
-           if (op->ch2 != -1)
-               total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
-           res = valuePop(ctxt);
-           if (res != NULL) {
-               xmlXPathReleaseObject(ctxt->context, res);
-           }
-           valuePush(ctxt, obj);
-           CHECK_ERROR0;
-           return (total);
-       }
        newlocset = xmlXPtrLocationSetCreate(NULL);
 
        for (i = 0; i < oldlocset->locNr; i++) {
@@ -13076,8 +13042,8 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
            if (op->ch2 != -1)
                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            if (ctxt->error != XPATH_EXPRESSION_OK) {
-               xmlXPathFreeObject(obj);
-               return(0);
+                xmlXPtrFreeLocationSet(newlocset);
+                goto xptr_error;
            }
            /*
            * The result of the evaluation need to be tested to
@@ -13105,7 +13071,6 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
                /* OLD: xmlXPathFreeObject(res); */
            } else
                tmp = NULL;
-           ctxt->context->node = NULL;
            /*
            * Only put the first node in the result, then leave.
            */
@@ -13120,12 +13085,12 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
        /*
        * The result is used as the new evaluation locset.
        */
-       xmlXPathReleaseObject(ctxt->context, obj);
-       ctxt->context->node = NULL;
-       ctxt->context->contextSize = -1;
-       ctxt->context->proximityPosition = -1;
        valuePush(ctxt, xmlXPtrWrapLocationSet(newlocset));
+xptr_error:
+       xmlXPathReleaseObject(ctxt->context, obj);
        ctxt->context->node = oldnode;
+       ctxt->context->contextSize = oldcs;
+       ctxt->context->proximityPosition = oldpp;
        return (total);
     }
 #endif /* LIBXML_XPTR_ENABLED */
@@ -13136,32 +13101,19 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
     * up a new set.
     */
     CHECK_TYPE0(XPATH_NODESET);
-    obj = valuePop(ctxt);
-    oldset = obj->nodesetval;
-
-    oldnode = ctxt->context->node;
-    oldDoc = ctxt->context->doc;
-    ctxt->context->node = NULL;
 
-    if ((oldset == NULL) || (oldset->nodeNr == 0)) {
-       ctxt->context->contextSize = 0;
-       ctxt->context->proximityPosition = 0;
-       /* QUESTION TODO: Why was this code commented out?
-           if (op->ch2 != -1)
-               total +=
-                   xmlXPathCompOpEval(ctxt,
-                       &comp->steps[op->ch2]);
-           CHECK_ERROR0;
-           res = valuePop(ctxt);
-           if (res != NULL)
-               xmlXPathFreeObject(res);
-       */
-       valuePush(ctxt, obj);
-       ctxt->context->node = oldnode;
-       CHECK_ERROR0;
-    } else {
+    if ((ctxt->value->nodesetval != NULL) &&
+        (ctxt->value->nodesetval->nodeNr != 0)) {
        xmlNodeSetPtr newset;
        xmlXPathObjectPtr tmp = NULL;
+
+        obj = valuePop(ctxt);
+        oldset = obj->nodesetval;
+        oldnode = ctxt->context->node;
+        oldDoc = ctxt->context->doc;
+        oldcs = ctxt->context->contextSize;
+        oldpp = ctxt->context->proximityPosition;
+
        /*
        * Initialize the new set.
        * Also set the xpath document in case things like
@@ -13195,8 +13147,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            if (ctxt->error != XPATH_EXPRESSION_OK) {
                xmlXPathFreeNodeSet(newset);
-               xmlXPathFreeObject(obj);
-               return(0);
+                goto error;
            }
            /*
            * The result of the evaluation needs to be tested to
@@ -13223,7 +13174,6 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
                xmlXPathNodeSetClear(tmp->nodesetval, 1);
            } else
                tmp = NULL;
-           ctxt->context->node = NULL;
            /*
            * Only put the first node in the result, then leave.
            */
@@ -13238,15 +13188,14 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
        /*
        * The result is used as the new evaluation set.
        */
+       valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt->context, newset));
+error:
        xmlXPathReleaseObject(ctxt->context, obj);
-       ctxt->context->node = NULL;
-       ctxt->context->contextSize = -1;
-       ctxt->context->proximityPosition = -1;
-       /* may want to move this past the '}' later */
+       ctxt->context->node = oldnode;
        ctxt->context->doc = oldDoc;
-       valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt->context, newset));
+       ctxt->context->contextSize = oldcs;
+       ctxt->context->proximityPosition = oldpp;
     }
-    ctxt->context->node = oldnode;
     return(total);
 }
 #endif /* XP_OPTIMIZED_FILTER_FIRST */
@@ -13266,10 +13215,6 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
     int equal, ret;
     xmlXPathCompExprPtr comp;
     xmlXPathObjectPtr arg1, arg2;
-    xmlNodePtr bak;
-    xmlDocPtr bakd;
-    int pp;
-    int cs;
 
     CHECK_ERROR0;
     comp = ctxt->comp;
@@ -13277,68 +13222,42 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
         case XPATH_OP_END:
             return (0);
         case XPATH_OP_AND:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
            CHECK_ERROR0;
             xmlXPathBooleanFunction(ctxt, 1);
             if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
                 return (total);
             arg2 = valuePop(ctxt);
-           ctxt->context->doc = bakd;
-           ctxt->context->node = bak;
-           ctxt->context->proximityPosition = pp;
-           ctxt->context->contextSize = cs;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            if (ctxt->error) {
                xmlXPathFreeObject(arg2);
                return(0);
            }
             xmlXPathBooleanFunction(ctxt, 1);
-            arg1 = valuePop(ctxt);
-            arg1->boolval &= arg2->boolval;
-            valuePush(ctxt, arg1);
+            if (ctxt->value != NULL)
+                ctxt->value->boolval &= arg2->boolval;
            xmlXPathReleaseObject(ctxt->context, arg2);
             return (total);
         case XPATH_OP_OR:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
            CHECK_ERROR0;
             xmlXPathBooleanFunction(ctxt, 1);
             if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
                 return (total);
             arg2 = valuePop(ctxt);
-           ctxt->context->doc = bakd;
-           ctxt->context->node = bak;
-           ctxt->context->proximityPosition = pp;
-           ctxt->context->contextSize = cs;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            if (ctxt->error) {
                xmlXPathFreeObject(arg2);
                return(0);
            }
             xmlXPathBooleanFunction(ctxt, 1);
-            arg1 = valuePop(ctxt);
-            arg1->boolval |= arg2->boolval;
-            valuePush(ctxt, arg1);
+            if (ctxt->value != NULL)
+                ctxt->value->boolval |= arg2->boolval;
            xmlXPathReleaseObject(ctxt->context, arg2);
             return (total);
         case XPATH_OP_EQUAL:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
            CHECK_ERROR0;
-           ctxt->context->doc = bakd;
-           ctxt->context->node = bak;
-           ctxt->context->proximityPosition = pp;
-           ctxt->context->contextSize = cs;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            CHECK_ERROR0;
            if (op->value)
@@ -13348,33 +13267,17 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
            valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt->context, equal));
             return (total);
         case XPATH_OP_CMP:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
            CHECK_ERROR0;
-           ctxt->context->doc = bakd;
-           ctxt->context->node = bak;
-           ctxt->context->proximityPosition = pp;
-           ctxt->context->contextSize = cs;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            CHECK_ERROR0;
             ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
            valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt->context, ret));
             return (total);
         case XPATH_OP_PLUS:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
            CHECK_ERROR0;
             if (op->ch2 != -1) {
-               ctxt->context->doc = bakd;
-               ctxt->context->node = bak;
-               ctxt->context->proximityPosition = pp;
-               ctxt->context->contextSize = cs;
                 total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            }
            CHECK_ERROR0;
@@ -13390,16 +13293,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
             }
             return (total);
         case XPATH_OP_MULT:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
            CHECK_ERROR0;
-           ctxt->context->doc = bakd;
-           ctxt->context->node = bak;
-           ctxt->context->proximityPosition = pp;
-           ctxt->context->contextSize = cs;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            CHECK_ERROR0;
             if (op->value == 0)
@@ -13410,16 +13305,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                 xmlXPathModValues(ctxt);
             return (total);
         case XPATH_OP_UNION:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
            CHECK_ERROR0;
-           ctxt->context->doc = bakd;
-           ctxt->context->node = bak;
-           ctxt->context->proximityPosition = pp;
-           ctxt->context->contextSize = cs;
             total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
            CHECK_ERROR0;
 
@@ -13456,15 +13343,6 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
            valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt->context,
                ctxt->context->node));
             return (total);
-        case XPATH_OP_RESET:
-            if (op->ch1 != -1)
-                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
-           CHECK_ERROR0;
-            if (op->ch2 != -1)
-                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
-           CHECK_ERROR0;
-            ctxt->context->node = NULL;
-            return (total);
         case XPATH_OP_COLLECT:{
                 if (op->ch1 == -1)
                     return (total);
@@ -13583,24 +13461,12 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                 return (total);
             }
         case XPATH_OP_ARG:
-           bakd = ctxt->context->doc;
-           bak = ctxt->context->node;
-           pp = ctxt->context->proximityPosition;
-           cs = ctxt->context->contextSize;
             if (op->ch1 != -1) {
                 total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
-                ctxt->context->contextSize = cs;
-                ctxt->context->proximityPosition = pp;
-                ctxt->context->node = bak;
-                ctxt->context->doc = bakd;
                CHECK_ERROR0;
             }
             if (op->ch2 != -1) {
                 total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
-                ctxt->context->contextSize = cs;
-                ctxt->context->proximityPosition = pp;
-                ctxt->context->node = bak;
-                ctxt->context->doc = bakd;
                CHECK_ERROR0;
            }
             return (total);
@@ -13612,6 +13478,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                 xmlNodeSetPtr oldset;
                 xmlNodePtr oldnode;
                xmlDocPtr oldDoc;
+                int oldcs, oldpp;
                 int i;
 
                 /*
@@ -13714,8 +13581,6 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                 if (ctxt->value == NULL)
                     return (total);
 
-                oldnode = ctxt->context->node;
-
 #ifdef LIBXML_XPTR_ENABLED
                 /*
                  * Hum are we filtering the result of an XPointer expression
@@ -13730,25 +13595,17 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                      * up a new locset.
                      */
                     CHECK_TYPE0(XPATH_LOCATIONSET);
+
+                    if ((ctxt->value->user == NULL) ||
+                        (((xmlLocationSetPtr) ctxt->value->user)->locNr == 0))
+                        return (total);
+
                     obj = valuePop(ctxt);
                     oldlocset = obj->user;
-                    ctxt->context->node = NULL;
+                    oldnode = ctxt->context->node;
+                    oldcs = ctxt->context->contextSize;
+                    oldpp = ctxt->context->proximityPosition;
 
-                    if ((oldlocset == NULL) || (oldlocset->locNr == 0)) {
-                        ctxt->context->contextSize = 0;
-                        ctxt->context->proximityPosition = 0;
-                        if (op->ch2 != -1)
-                            total +=
-                                xmlXPathCompOpEval(ctxt,
-                                                   &comp->steps[op->ch2]);
-                        res = valuePop(ctxt);
-                        if (res != NULL) {
-                           xmlXPathReleaseObject(ctxt->context, res);
-                       }
-                        valuePush(ctxt, obj);
-                        CHECK_ERROR0;
-                        return (total);
-                    }
                     newlocset = xmlXPtrLocationSetCreate(NULL);
 
                     for (i = 0; i < oldlocset->locNr; i++) {
@@ -13768,8 +13625,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                                 xmlXPathCompOpEval(ctxt,
                                                    &comp->steps[op->ch2]);
                        if (ctxt->error != XPATH_EXPRESSION_OK) {
-                           xmlXPathFreeObject(obj);
-                           return(0);
+                            xmlXPtrFreeLocationSet(newlocset);
+                            goto filter_xptr_error;
                        }
 
                         /*
@@ -13793,19 +13650,17 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                             res = valuePop(ctxt);
                            xmlXPathReleaseObject(ctxt->context, res);
                         }
-
-                        ctxt->context->node = NULL;
                     }
 
                     /*
                      * The result is used as the new evaluation locset.
                      */
-                   xmlXPathReleaseObject(ctxt->context, obj);
-                    ctxt->context->node = NULL;
-                    ctxt->context->contextSize = -1;
-                    ctxt->context->proximityPosition = -1;
                     valuePush(ctxt, xmlXPtrWrapLocationSet(newlocset));
+filter_xptr_error:
+                   xmlXPathReleaseObject(ctxt->context, obj);
                     ctxt->context->node = oldnode;
+                    ctxt->context->contextSize = oldcs;
+                    ctxt->context->proximityPosition = oldpp;
                     return (total);
                 }
 #endif /* LIBXML_XPTR_ENABLED */
@@ -13816,30 +13671,15 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                  * up a new set.
                  */
                 CHECK_TYPE0(XPATH_NODESET);
-                obj = valuePop(ctxt);
-                oldset = obj->nodesetval;
-
-                oldnode = ctxt->context->node;
-               oldDoc = ctxt->context->doc;
-                ctxt->context->node = NULL;
 
-                if ((oldset == NULL) || (oldset->nodeNr == 0)) {
-                    ctxt->context->contextSize = 0;
-                    ctxt->context->proximityPosition = 0;
-/*
-                    if (op->ch2 != -1)
-                        total +=
-                            xmlXPathCompOpEval(ctxt,
-                                               &comp->steps[op->ch2]);
-                   CHECK_ERROR0;
-                    res = valuePop(ctxt);
-                    if (res != NULL)
-                        xmlXPathFreeObject(res);
-*/
-                    valuePush(ctxt, obj);
-                    ctxt->context->node = oldnode;
-                    CHECK_ERROR0;
-                } else {
+                if ((ctxt->value->nodesetval != NULL) &&
+                    (ctxt->value->nodesetval->nodeNr != 0)) {
+                    obj = valuePop(ctxt);
+                    oldset = obj->nodesetval;
+                    oldnode = ctxt->context->node;
+                    oldDoc = ctxt->context->doc;
+                    oldcs = ctxt->context->contextSize;
+                    oldpp = ctxt->context->proximityPosition;
                    tmp = NULL;
                     /*
                      * Initialize the new set.
@@ -13905,8 +13745,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                                                    &comp->steps[op->ch2]);
                        if (ctxt->error != XPATH_EXPRESSION_OK) {
                            xmlXPathFreeNodeSet(newset);
-                           xmlXPathFreeObject(obj);
-                           return(0);
+                            goto filter_error;
                        }
 
                         /*
@@ -13940,23 +13779,21 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                            */
                         } else
                            tmp = NULL;
-                        ctxt->context->node = NULL;
                     }
                    if (tmp != NULL)
                        xmlXPathReleaseObject(ctxt->context, tmp);
                     /*
                      * The result is used as the new evaluation set.
                      */
-                   xmlXPathReleaseObject(ctxt->context, obj);
-                    ctxt->context->node = NULL;
-                    ctxt->context->contextSize = -1;
-                    ctxt->context->proximityPosition = -1;
-                   /* may want to move this past the '}' later */
-                   ctxt->context->doc = oldDoc;
                    valuePush(ctxt,
                        xmlXPathCacheWrapNodeSet(ctxt->context, newset));
+filter_error:
+                   xmlXPathReleaseObject(ctxt->context, obj);
+                   ctxt->context->node = oldnode;
+                   ctxt->context->doc = oldDoc;
+                    ctxt->context->contextSize = oldcs;
+                    ctxt->context->proximityPosition = oldpp;
                 }
-                ctxt->context->node = oldnode;
                 return (total);
             }
         case XPATH_OP_SORT:
@@ -13979,6 +13816,9 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                 xmlLocationSetPtr newlocset = NULL;
                    xmlLocationSetPtr oldlocset;
                 xmlNodeSetPtr oldset;
+                xmlNodePtr oldnode = ctxt->context->node;
+                int oldcs = ctxt->context->contextSize;
+                int oldpp = ctxt->context->proximityPosition;
                 int i, j;
 
                 if (op->ch1 != -1) {
@@ -13999,22 +13839,14 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                      * up a new locset.
                      */
                     CHECK_TYPE0(XPATH_LOCATIONSET);
+
+                    if ((ctxt->value->user == NULL) ||
+                        (((xmlLocationSetPtr) ctxt->value->user)->locNr == 0))
+                        return (total);
+
                     obj = valuePop(ctxt);
                     oldlocset = obj->user;
 
-                    if ((oldlocset == NULL) || (oldlocset->locNr == 0)) {
-                       ctxt->context->node = NULL;
-                        ctxt->context->contextSize = 0;
-                        ctxt->context->proximityPosition = 0;
-                        total += xmlXPathCompOpEval(ctxt,&comp->steps[op->ch2]);
-                        res = valuePop(ctxt);
-                        if (res != NULL) {
-                           xmlXPathReleaseObject(ctxt->context, res);
-                       }
-                        valuePush(ctxt, obj);
-                        CHECK_ERROR0;
-                        return (total);
-                    }
                     newlocset = xmlXPtrLocationSetCreate(NULL);
 
                     for (i = 0; i < oldlocset->locNr; i++) {
@@ -14034,8 +13866,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                                 xmlXPathCompOpEval(ctxt,
                                                    &comp->steps[op->ch2]);
                        if (ctxt->error != XPATH_EXPRESSION_OK) {
-                           xmlXPathFreeObject(obj);
-                           return(0);
+                            xmlXPtrFreeLocationSet(newlocset);
+                            goto rangeto_error;
                        }
 
                         res = valuePop(ctxt);
@@ -14070,14 +13902,11 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                             res = valuePop(ctxt);
                            xmlXPathReleaseObject(ctxt->context, res);
                         }
-
-                        ctxt->context->node = NULL;
                     }
                } else {        /* Not a location set */
                     CHECK_TYPE0(XPATH_NODESET);
                     obj = valuePop(ctxt);
                     oldset = obj->nodesetval;
-                    ctxt->context->node = NULL;
 
                     newlocset = xmlXPtrLocationSetCreate(NULL);
 
@@ -14100,8 +13929,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                                     xmlXPathCompOpEval(ctxt,
                                                    &comp->steps[op->ch2]);
                            if (ctxt->error != XPATH_EXPRESSION_OK) {
-                               xmlXPathFreeObject(obj);
-                               return(0);
+                                xmlXPtrFreeLocationSet(newlocset);
+                                goto rangeto_error;
                            }
 
                             res = valuePop(ctxt);
@@ -14122,8 +13951,6 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                                 res = valuePop(ctxt);
                                xmlXPathReleaseObject(ctxt->context, res);
                             }
-
-                            ctxt->context->node = NULL;
                         }
                     }
                 }
@@ -14131,11 +13958,12 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
                 /*
                  * The result is used as the new evaluation set.
                  */
-               xmlXPathReleaseObject(ctxt->context, obj);
-                ctxt->context->node = NULL;
-                ctxt->context->contextSize = -1;
-                ctxt->context->proximityPosition = -1;
                 valuePush(ctxt, xmlXPtrWrapLocationSet(newlocset));
+rangeto_error:
+               xmlXPathReleaseObject(ctxt->context, obj);
+                ctxt->context->node = oldnode;
+                ctxt->context->contextSize = oldcs;
+                ctxt->context->proximityPosition = oldpp;
                 return (total);
             }
 #endif /* LIBXML_XPTR_ENABLED */
index 2b3cb2c..e894e52 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/xzlib.c b/xzlib.c
index a839169..0ba88cf 100644 (file)
--- a/xzlib.c
+++ b/xzlib.c
@@ -562,6 +562,10 @@ xz_decomp(xz_statep state)
                          "internal error: inflate stream corrupt");
                 return -1;
             }
+            /*
+             * FIXME: Remapping a couple of error codes and falling through
+             * to the LZMA error handling looks fragile.
+             */
             if (ret == Z_MEM_ERROR)
                 ret = LZMA_MEM_ERROR;
             if (ret == Z_DATA_ERROR)
@@ -587,6 +591,11 @@ xz_decomp(xz_statep state)
             xz_error(state, LZMA_PROG_ERROR, "compression error");
             return -1;
         }
+        if ((state->how != GZIP) &&
+            (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) {
+            xz_error(state, ret, "lzma error");
+            return -1;
+        }
     } while (strm->avail_out && ret != LZMA_STREAM_END);
 
     /* update available output and crc check value */