MCPcopy Create free account
hub / github.com/cuberite/cuberite / externalEntityInitProcessor2

Function externalEntityInitProcessor2

lib/expat/xmlparse.c:2047–2085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2045}
2046
2047static enum XML_Error PTRCALL
2048externalEntityInitProcessor2(XML_Parser parser,
2049 const char *start,
2050 const char *end,
2051 const char **endPtr)
2052{
2053 const char *next = start; /* XmlContentTok doesn't always set the last arg */
2054 int tok = XmlContentTok(encoding, start, end, &next);
2055 switch (tok) {
2056 case XML_TOK_BOM:
2057 /* If we are at the end of the buffer, this would cause the next stage,
2058 i.e. externalEntityInitProcessor3, to pass control directly to
2059 doContent (by detecting XML_TOK_NONE) without processing any xml text
2060 declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent.
2061 */
2062 if (next == end && !ps_finalBuffer) {
2063 *endPtr = next;
2064 return XML_ERROR_NONE;
2065 }
2066 start = next;
2067 break;
2068 case XML_TOK_PARTIAL:
2069 if (!ps_finalBuffer) {
2070 *endPtr = start;
2071 return XML_ERROR_NONE;
2072 }
2073 eventPtr = start;
2074 return XML_ERROR_UNCLOSED_TOKEN;
2075 case XML_TOK_PARTIAL_CHAR:
2076 if (!ps_finalBuffer) {
2077 *endPtr = start;
2078 return XML_ERROR_NONE;
2079 }
2080 eventPtr = start;
2081 return XML_ERROR_PARTIAL_CHAR;
2082 }
2083 processor = externalEntityInitProcessor3;
2084 return externalEntityInitProcessor3(parser, start, end, endPtr);
2085}
2086
2087static enum XML_Error PTRCALL
2088externalEntityInitProcessor3(XML_Parser parser,

Callers 1

Calls 1

Tested by

no test coverage detected