diff --git a/expat/Makefile.in b/expat/Makefile.in index 02d0bfa2..f2ae36da 100644 --- a/expat/Makefile.in +++ b/expat/Makefile.in @@ -169,6 +169,13 @@ tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata. tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) $(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) +tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c +tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) + $(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) + +run-benchmark: tests/benchmark/benchmark + tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + tests/xmlts.zip: wget --output-document=tests/xmlts.zip \ http://www.w3.org/XML/Test/xmlts20020606.zip diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index b7389eba..f35aa36b 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -433,7 +433,7 @@ getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr, const char *end); static unsigned long generate_hash_secret_salt(void); -static XML_Bool parsingSetup(XML_Parser parser); +static XML_Bool startParsing(XML_Parser parser); static XML_Parser parserCreate(const XML_Char *encodingName, @@ -698,13 +698,13 @@ generate_hash_secret_salt(void) return rand(); } -static XML_Bool -parsingSetup(XML_Parser parser) +static XML_Bool /* only valid for root parser */ +startParsing(XML_Parser parser) { /* hash functions must be initialized before setContext() is called */ if (hash_secret_salt == 0) hash_secret_salt = generate_hash_secret_salt(); - if (parser != NULL && ns) { + if (ns) { /* implicit context only set for root parser, since child parsers (i.e. external entity parsers) will inherit it */ @@ -1507,7 +1507,7 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; case XML_INITIALIZED: - if (!parsingSetup(parser)) { + if (parentParser == NULL && !startParsing(parser)) { errorCode = XML_ERROR_NO_MEMORY; return XML_STATUS_ERROR; } @@ -1633,7 +1633,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; case XML_INITIALIZED: - if (!parsingSetup(parser)) { + if (parentParser == NULL && !startParsing(parser)) { errorCode = XML_ERROR_NO_MEMORY; return XML_STATUS_ERROR; }