Skip to content

Commit

Permalink
Update to libxml-2.12.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyolee committed Dec 14, 2023
1 parent 0d475b2 commit ae1e38b
Show file tree
Hide file tree
Showing 24 changed files with 87 additions and 71 deletions.
15 changes: 15 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
NEWS file for libxml2

v2.12.3: Dec 12 2023

### Regressions

- parser: Fix namespaces redefined from default attributes

### Build fixes

- include: Rename XML_EMPTY helper macro
- include: Move declaration of xmlInitGlobals
- include: Add missing includes
- include: Move globals from xmlsave.h to parser.h
- include: Readd circular dependency between tree.h and parser.h


v2.12.2: Dec 5 2023

### Regressions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

libxml2 Windows build with Visual Studio.

This version is libxml2-2.12.2.
This version is libxml2-2.12.3.

Note that LZMA support is only available for VS2013 or later.

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion distfiles/download.url
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.2.tar.xz
https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.3.tar.xz
Binary file removed distfiles/libxml2-2.12.2.tar.xz
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fec7ecfe714722b2bb0aaff7d200c701 Copyright
8274a9d01a67fd01a069f62805127a25 HTMLparser.c
ac5d42c343d2093d2a031f59036c5f99 HTMLtree.c
dd63184811cb2ff705c3e466364d3773 INSTALL
ca9d8f60a489e6917a92af54b4ae765c NEWS
da5e67a440cb3ee4e3946ba845eead02 NEWS
d52aad5f8ace0ed3e5f9b126d72473e1 README.libxml2.md
7283878f36a935a3c00df077cf45af54 SAX.c
15289caf4cf19277a510d22c24238a73 SAX2.c
Expand All @@ -15,7 +15,7 @@ d1071113f634435266c21de0bffc0315 dict.c
10a103a4ea5dce7e3906291f958b7e9f encoding.c
83e8ff3c5b69908c4a93357bdc60e91c entities.c
bbb4bd2d42423b727ef64d7ce71611f6 error.c
7e4ee90a431b04666202b3ccd2dfa5ba globals.c
d9d2840f8f9f3e7f5ca35862bfeebf97 globals.c
33d90ee08788d335c459779c0c5fd6e5 hash.c
c3cd3bf7e9b4c37de582641b614cf6e8 include/libxml/HTMLparser.h
bb4e2df91d33306ab3c2d71374559877 include/libxml/HTMLtree.h
Expand All @@ -27,33 +27,33 @@ dbcef76d0839253958697a919ddeea31 include/libxml/c14n.h
79bb0a2a5b7cde377bb215214d0ea6d6 include/libxml/debugXML.h
d00de0e505d1b4dfcccf9ff38837b61a include/libxml/dict.h
e567122520ed052588fd6469f2efbc59 include/libxml/encoding.h
8cc00d7ea1f9be612e1703085bf8a2c1 include/libxml/entities.h
8307724e4e8be766d94d1523600650c3 include/libxml/globals.h
b083ed530f79f607acbc1012281852d7 include/libxml/entities.h
bc51344e21f8d3b7f0fc93cc9d554243 include/libxml/globals.h
480b0bd8dded0583369dd8a4be21d450 include/libxml/hash.h
6c03428a747fbfab599d4e86dd17d6b1 include/libxml/list.h
d5c907a6d7d205e286168e007f32504c include/libxml/nanoftp.h
3f166ef07a961ee21d3561682d859edc include/libxml/nanohttp.h
ac7a4b3593e7f6fbc8bd8118c24fdf06 include/libxml/parser.h
ca827023c1dee058837ce0360e88fa3e include/libxml/parser.h
36c2360e8bdaac08bfccba24e461d07f include/libxml/parserInternals.h
f1afd2d52bf66fbf45f02dc35c72c3eb include/libxml/pattern.h
5c004f394f8ea72b37b7b4ad5f963863 include/libxml/relaxng.h
8fa4c6ec9573dd4fb714a46217d23b64 include/libxml/schemasInternals.h
0e69ad4708a9ddd923e500c5db268a2d include/libxml/schematron.h
d752e41ee40c2b028d0adb34ffc38810 include/libxml/relaxng.h
853377a2dbf74e9b0d679dcfcc1859b9 include/libxml/schemasInternals.h
7a163ee849171ffc2471a89704a33643 include/libxml/schematron.h
84310bd67922e532329432f7ab04338c include/libxml/threads.h
d0d712df122765999772922a2c7ee79f include/libxml/tree.h
8508e1498b7772ae84baf83ddd33b65c include/libxml/tree.h
9e795965522a7b231084cbd5ab089eda include/libxml/uri.h
d8567b6cb3e016915754517708ec777e include/libxml/valid.h
f26be264a608ed72fb7c74de76e3be72 include/libxml/valid.h
d02d257861d28021ad33dad20e2683c3 include/libxml/xinclude.h
4c7ff0fcbc3595d38f47e41f703dbc61 include/libxml/xlink.h
c89f5d11097397b21b6a49492771fac5 include/libxml/xmlIO.h
b0ebaf812c8258f5e631287de979d537 include/libxml/xmlIO.h
78602d66c5db00b0deece2c56ab86d43 include/libxml/xmlautomata.h
6ca609e01ed4da1b96777b5e0776b4e9 include/libxml/xmlerror.h
e3fe66a1c3ca6359481c0a4fa25491c6 include/libxml/xmlerror.h
dc29dad477ae3b1779f8b15fbae14a0d include/libxml/xmlexports.h
e58a5b14c8313bae42985a3aaf4d02c1 include/libxml/xmlmemory.h
8eccb2172800caa343515fc0da596f4c include/libxml/xmlmemory.h
1dda0f8301c72cab8c0015a4f36d008f include/libxml/xmlmodule.h
abf4f7189ba11d03e73e22f9d1662328 include/libxml/xmlreader.h
5f98d803fb4dd3fda837e2f922ce4e6a include/libxml/xmlregexp.h
3d6e99f4fc2732b1f772f7e36764c364 include/libxml/xmlsave.h
2183378075a4a69030b3280c1fd2d1c0 include/libxml/xmlsave.h
f4c5548787cac73cd7c6d18a07555393 include/libxml/xmlschemas.h
ac3b6d0c4a6fc4ea9fea5652b46b2992 include/libxml/xmlschemastypes.h
74cf81ae5e6c6b553e49683528d78b6b include/libxml/xmlstring.h
Expand Down Expand Up @@ -86,7 +86,7 @@ c2b5c54ee40fd7bfba8eb6b9e90d6dbd libxml.h
67985a9e0fc42eebc29d12b884baa00a list.c
a9e486124ef2c3a00ecb44001d774484 nanoftp.c
a2c34ca6d295906ebc9b56d8e056bf7a nanohttp.c
0f379762fd2331ac9eb413162c899538 parser.c
55cd384ef09aedba5a740cf9cf0f3d2c parser.c
1064b876a87533052e48e7e570c4e670 parserInternals.c
8809dafc22e8463d81a392ac8a853a59 pattern.c
15a40570e75a1cf9f9da7350f9557b86 relaxng.c
Expand Down
Binary file added distfiles/libxml2-2.12.3.tar.xz
Binary file not shown.
2 changes: 0 additions & 2 deletions globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ XML_GLOBALS_ERROR
XML_GLOBALS_HTML
XML_GLOBALS_IO
XML_GLOBALS_PARSER
XML_GLOBALS_SAVE
XML_GLOBALS_TREE
#undef XML_OP
};
Expand Down Expand Up @@ -908,7 +907,6 @@ XML_GLOBALS_ERROR
XML_GLOBALS_HTML
XML_GLOBALS_IO
XML_GLOBALS_PARSER
XML_GLOBALS_SAVE
XML_GLOBALS_TREE
#undef XML_OP

Expand Down
2 changes: 2 additions & 0 deletions include/libxml/entities.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#define __XML_ENTITIES_H__

#include <libxml/xmlversion.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
#undef XML_TREE_INTERNALS

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 0 additions & 4 deletions include/libxml/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ extern "C" {
typedef struct _xmlGlobalState xmlGlobalState;
typedef xmlGlobalState *xmlGlobalStatePtr;

XML_DEPRECATED XMLPUBFUN void
xmlInitGlobals(void);
XML_DEPRECATED XMLPUBFUN void
xmlCleanupGlobals(void);
XML_DEPRECATED XMLPUBFUN void
xmlInitializeGlobalState(xmlGlobalStatePtr gs);
XML_DEPRECATED XMLPUBFUN
Expand Down
16 changes: 15 additions & 1 deletion include/libxml/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#define __XML_PARSER_H__

#include <libxml/xmlversion.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
#undef XML_TREE_INTERNALS
#include <libxml/dict.h>
#include <libxml/hash.h>
#include <libxml/valid.h>
Expand Down Expand Up @@ -857,7 +859,10 @@ XMLPUBFUN const char *const *__xmlParserVersion(void);
XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlParserDebugEntities, int, XML_DEPRECATED) \
XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED)
XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED) \
XML_OP(xmlIndentTreeOutput, int, XML_NO_ATTR) \
XML_OP(xmlTreeIndentString, const char *, XML_NO_ATTR) \
XML_OP(xmlSaveNoEmptyTags, int, XML_NO_ATTR)

#ifdef LIBXML_SAX1_ENABLED
#define XML_GLOBALS_PARSER_SAX1 \
Expand Down Expand Up @@ -891,6 +896,9 @@ XML_GLOBALS_PARSER
XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue)
#define xmlSubstituteEntitiesDefaultValue \
XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue)
#define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
#define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
#define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
#endif
/** DOC_ENABLE */

Expand All @@ -901,6 +909,12 @@ XMLPUBFUN void
xmlInitParser (void);
XMLPUBFUN void
xmlCleanupParser (void);
XML_DEPRECATED
XMLPUBFUN void
xmlInitGlobals (void);
XML_DEPRECATED
XMLPUBFUN void
xmlCleanupGlobals (void);

/*
* Input functions
Expand Down
1 change: 1 addition & 0 deletions include/libxml/relaxng.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <libxml/xmlversion.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlstring.h>
#include <libxml/tree.h>

#ifdef LIBXML_SCHEMAS_ENABLED

Expand Down
1 change: 1 addition & 0 deletions include/libxml/schemasInternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <libxml/xmlregexp.h>
#include <libxml/hash.h>
#include <libxml/dict.h>
#include <libxml/tree.h>

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions include/libxml/schematron.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#ifdef LIBXML_SCHEMATRON_ENABLED

#include <libxml/xmlerror.h>
#include <libxml/tree.h>

#ifdef __cplusplus
Expand Down
11 changes: 11 additions & 0 deletions include/libxml/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
* Author: Daniel Veillard
*/

#ifndef XML_TREE_INTERNALS

/*
* Emulate circular dependency for backward compatibility
*/
#include <libxml/parser.h>

#else /* XML_TREE_INTERNALS */

#ifndef __XML_TREE_H__
#define __XML_TREE_H__

Expand Down Expand Up @@ -1349,3 +1358,5 @@ XML_DEPRECATED XMLPUBFUN int

#endif /* __XML_TREE_H__ */

#endif /* XML_TREE_INTERNALS */

2 changes: 2 additions & 0 deletions include/libxml/valid.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

#include <libxml/xmlversion.h>
#include <libxml/xmlerror.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
#undef XML_TREE_INTERNALS
#include <libxml/list.h>
#include <libxml/xmlautomata.h>
#include <libxml/xmlregexp.h>
Expand Down
2 changes: 2 additions & 0 deletions include/libxml/xmlIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#include <stdio.h>
#include <libxml/xmlversion.h>
#include <libxml/encoding.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
#undef XML_TREE_INTERNALS

#ifdef __cplusplus
extern "C" {
Expand Down
8 changes: 4 additions & 4 deletions include/libxml/xmlerror.h
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,10 @@ typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
/** DOC_DISABLE */
#define XML_GLOBALS_ERROR \
XML_OP(xmlLastError, xmlError, XML_DEPRECATED) \
XML_OP(xmlGenericError, xmlGenericErrorFunc, XML_EMPTY) \
XML_OP(xmlGenericErrorContext, void *, XML_EMPTY) \
XML_OP(xmlStructuredError, xmlStructuredErrorFunc, XML_EMPTY) \
XML_OP(xmlStructuredErrorContext, void *, XML_EMPTY)
XML_OP(xmlGenericError, xmlGenericErrorFunc, XML_NO_ATTR) \
XML_OP(xmlGenericErrorContext, void *, XML_NO_ATTR) \
XML_OP(xmlStructuredError, xmlStructuredErrorFunc, XML_NO_ATTR) \
XML_OP(xmlStructuredErrorContext, void *, XML_NO_ATTR)

#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_ERROR
Expand Down
10 changes: 5 additions & 5 deletions include/libxml/xmlmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ typedef char *(*xmlStrdupFunc)(const char *str);
/** DOC_DISABLE */
#ifdef LIBXML_THREAD_ALLOC_ENABLED
#define XML_GLOBALS_ALLOC \
XML_OP(xmlMalloc, xmlMallocFunc, XML_EMPTY) \
XML_OP(xmlMallocAtomic, xmlMallocFunc, XML_EMPTY) \
XML_OP(xmlRealloc, xmlReallocFunc, XML_EMPTY) \
XML_OP(xmlFree, xmlFreeFunc, XML_EMPTY) \
XML_OP(xmlMemStrdup, xmlStrdupFunc, XML_EMPTY)
XML_OP(xmlMalloc, xmlMallocFunc, XML_NO_ATTR) \
XML_OP(xmlMallocAtomic, xmlMallocFunc, XML_NO_ATTR) \
XML_OP(xmlRealloc, xmlReallocFunc, XML_NO_ATTR) \
XML_OP(xmlFree, xmlFreeFunc, XML_NO_ATTR) \
XML_OP(xmlMemStrdup, xmlStrdupFunc, XML_NO_ATTR)
#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_ALLOC
#undef XML_OP
Expand Down
23 changes: 0 additions & 23 deletions include/libxml/xmlsave.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,6 @@ typedef enum {
typedef struct _xmlSaveCtxt xmlSaveCtxt;
typedef xmlSaveCtxt *xmlSaveCtxtPtr;

/** DOC_DISABLE */
#define XML_GLOBALS_SAVE \
XML_OP(xmlIndentTreeOutput, int, XML_EMPTY) \
XML_OP(xmlTreeIndentString, const char *, XML_EMPTY) \
XML_OP(xmlSaveNoEmptyTags, int, XML_EMPTY)

#define XML_OP XML_DECLARE_GLOBAL
XML_GLOBALS_SAVE
#undef XML_OP

#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
#define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
#define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
#define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
#endif
/** DOC_ENABLE */

XMLPUBFUN xmlSaveCtxtPtr
xmlSaveToFd (int fd,
const char *encoding,
Expand Down Expand Up @@ -108,12 +91,6 @@ XMLPUBFUN int
}
#endif

#else /* LIBXML_OUTPUT_ENABLED */

/** DOC_DISABLE */
#define XML_GLOBALS_SAVE
/** DOC_ENABLE */

#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* __XML_XMLSAVE_H__ */

Expand Down
10 changes: 5 additions & 5 deletions include/libxml/xmlversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ XMLPUBFUN void xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.12.2"
#define LIBXML_DOTTED_VERSION "2.12.3"

/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 21202
#define LIBXML_VERSION 21203

/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "21202"
#define LIBXML_VERSION_STRING "21203"

/**
* LIBXML_VERSION_EXTRA:
Expand All @@ -58,7 +58,7 @@ XMLPUBFUN void 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(21202);
#define LIBXML_TEST_VERSION xmlCheckVersion(21203);

#ifndef VMS
#if 0
Expand Down Expand Up @@ -494,7 +494,7 @@ XMLPUBFUN void xmlCheckVersion(int version);
#endif
#endif /* __GNUC__ */

#define XML_EMPTY
#define XML_NO_ATTR

#ifdef LIBXML_THREAD_ENABLED
#define XML_DECLARE_GLOBAL(name, type, attrs) \
Expand Down
12 changes: 4 additions & 8 deletions parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1689,13 +1689,11 @@ xmlParserNsPush(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix,
oldIndex = ctxt->nsdb->defaultNsIndex;

if (oldIndex != INT_MAX) {
if (defAttr != 0)
return(0);

extra = &ctxt->nsdb->extra[oldIndex];

if (extra->elementId == ctxt->nsdb->elementId) {
xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
if (defAttr == 0)
xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
return(0);
}

Expand All @@ -1715,14 +1713,12 @@ xmlParserNsPush(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix,
if (oldIndex != INT_MAX) {
extra = &ctxt->nsdb->extra[oldIndex];

if (defAttr != 0)
return(0);

/*
* Check for duplicate definitions on the same element.
*/
if (extra->elementId == ctxt->nsdb->elementId) {
xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
if (defAttr == 0)
xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
return(0);
}

Expand Down
Loading

0 comments on commit ae1e38b

Please sign in to comment.