summaryrefslogtreecommitdiffstats
path: root/Modules/expat/xmltok.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-07-14 21:12:35 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-07-14 21:12:35 (GMT)
commit64359d203e95f243eec661baa4226509a8bb2909 (patch)
treebef5640fd71a97f3e4f3602c045ff97241182e90 /Modules/expat/xmltok.c
parent94dc6736bd4a72e9af36d4df1c337bd0db5fd69c (diff)
downloadcpython-64359d203e95f243eec661baa4226509a8bb2909.zip
cpython-64359d203e95f243eec661baa4226509a8bb2909.tar.gz
cpython-64359d203e95f243eec661baa4226509a8bb2909.tar.bz2
Update the embedded copy of the expat XML parser to 2.1.0. It brings
with it a vareity of bug fixes, both security and behavior. See http://www.libexpat.org/ for the list. NOTE: I already backported the expat hash randomization fix in March. Fixes issue #14340.
Diffstat (limited to 'Modules/expat/xmltok.c')
-rw-r--r--Modules/expat/xmltok.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/Modules/expat/xmltok.c b/Modules/expat/xmltok.c
index db92247..bf09dfc 100644
--- a/Modules/expat/xmltok.c
+++ b/Modules/expat/xmltok.c
@@ -2,20 +2,22 @@
See the file COPYING for copying permission.
*/
+#include <stddef.h>
+
#ifdef COMPILED_FROM_DSP
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
-#elif defined(__amigaos4__)
+#elif defined(__amigaos__)
#include "amigaconfig.h"
+#elif defined(__WATCOMC__)
+#include "watcomconfig.h"
#else
#ifdef HAVE_EXPAT_CONFIG_H
#include <expat_config.h>
#endif
#endif /* ndef COMPILED_FROM_DSP */
-#include <stddef.h>
-
#include "expat_external.h"
#include "internal.h"
#include "xmltok.h"
@@ -295,7 +297,9 @@ sb_charMatches(const ENCODING *enc, const char *p, int c)
#endif
#define PREFIX(ident) normal_ ## ident
+#define XML_TOK_IMPL_C
#include "xmltok_impl.c"
+#undef XML_TOK_IMPL_C
#undef MINBPC
#undef BYTE_TYPE
@@ -692,7 +696,9 @@ little2_isNmstrtMin(const ENCODING *enc, const char *p)
#define IS_NMSTRT_CHAR(enc, p, n) (0)
#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
+#define XML_TOK_IMPL_C
#include "xmltok_impl.c"
+#undef XML_TOK_IMPL_C
#undef MINBPC
#undef BYTE_TYPE
@@ -831,7 +837,9 @@ big2_isNmstrtMin(const ENCODING *enc, const char *p)
#define IS_NMSTRT_CHAR(enc, p, n) (0)
#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
+#define XML_TOK_IMPL_C
#include "xmltok_impl.c"
+#undef XML_TOK_IMPL_C
#undef MINBPC
#undef BYTE_TYPE
@@ -1337,7 +1345,7 @@ unknown_toUtf16(const ENCODING *enc,
ENCODING *
XmlInitUnknownEncoding(void *mem,
int *table,
- CONVERTER convert,
+ CONVERTER convert,
void *userData)
{
int i;
@@ -1610,7 +1618,9 @@ initScan(const ENCODING * const *encodingTable,
#define NS(x) x
#define ns(x) x
+#define XML_TOK_NS_C
#include "xmltok_ns.c"
+#undef XML_TOK_NS_C
#undef NS
#undef ns
@@ -1619,7 +1629,9 @@ initScan(const ENCODING * const *encodingTable,
#define NS(x) x ## NS
#define ns(x) x ## _ns
+#define XML_TOK_NS_C
#include "xmltok_ns.c"
+#undef XML_TOK_NS_C
#undef NS
#undef ns
@@ -1627,7 +1639,7 @@ initScan(const ENCODING * const *encodingTable,
ENCODING *
XmlInitUnknownEncodingNS(void *mem,
int *table,
- CONVERTER convert,
+ CONVERTER convert,
void *userData)
{
ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData);