| OLD | NEW |
| 1 /* | 1 /* |
| 2 * parser.c : an XML 1.0 parser, namespaces and validity support are mostly | 2 * parser.c : an XML 1.0 parser, namespaces and validity support are mostly |
| 3 * implemented on top of the SAX interfaces | 3 * implemented on top of the SAX interfaces |
| 4 * | 4 * |
| 5 * References: | 5 * References: |
| 6 * The XML specification: | 6 * The XML specification: |
| 7 * http://www.w3.org/TR/REC-xml | 7 * http://www.w3.org/TR/REC-xml |
| 8 * Original 1.0 version: | 8 * Original 1.0 version: |
| 9 * http://www.w3.org/TR/1998/REC-xml-19980210 | 9 * http://www.w3.org/TR/1998/REC-xml-19980210 |
| 10 * XML second edition working draft | 10 * XML second edition working draft |
| (...skipping 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2580 } | 2580 } |
| 2581 xmlFree(rep); | 2581 xmlFree(rep); |
| 2582 rep = NULL; | 2582 rep = NULL; |
| 2583 } | 2583 } |
| 2584 } else if (ent != NULL) { | 2584 } else if (ent != NULL) { |
| 2585 int i = xmlStrlen(ent->name); | 2585 int i = xmlStrlen(ent->name); |
| 2586 const xmlChar *cur = ent->name; | 2586 const xmlChar *cur = ent->name; |
| 2587 | 2587 |
| 2588 buffer[nbchars++] = '&'; | 2588 buffer[nbchars++] = '&'; |
| 2589 if (nbchars > buffer_size - i - XML_PARSER_BUFFER_SIZE) { | 2589 if (nbchars > buffer_size - i - XML_PARSER_BUFFER_SIZE) { |
| 2590 » » growBuffer(buffer, XML_PARSER_BUFFER_SIZE); | 2590 » » growBuffer(buffer, i + XML_PARSER_BUFFER_SIZE); |
| 2591 } | 2591 } |
| 2592 for (;i > 0;i--) | 2592 for (;i > 0;i--) |
| 2593 buffer[nbchars++] = *cur++; | 2593 buffer[nbchars++] = *cur++; |
| 2594 buffer[nbchars++] = ';'; | 2594 buffer[nbchars++] = ';'; |
| 2595 } | 2595 } |
| 2596 } else if (c == '%' && (what & XML_SUBSTITUTE_PEREF)) { | 2596 } else if (c == '%' && (what & XML_SUBSTITUTE_PEREF)) { |
| 2597 if (xmlParserDebugEntities) | 2597 if (xmlParserDebugEntities) |
| 2598 xmlGenericError(xmlGenericErrorContext, | 2598 xmlGenericError(xmlGenericErrorContext, |
| 2599 "String decoding PE Reference: %.30s\n", str); | 2599 "String decoding PE Reference: %.30s\n", str); |
| 2600 ent = xmlParseStringPEReference(ctxt, &str); | 2600 ent = xmlParseStringPEReference(ctxt, &str); |
| (...skipping 12257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14858 if (stream == NULL) { | 14858 if (stream == NULL) { |
| 14859 xmlFreeParserInputBuffer(input); | 14859 xmlFreeParserInputBuffer(input); |
| 14860 return (NULL); | 14860 return (NULL); |
| 14861 } | 14861 } |
| 14862 inputPush(ctxt, stream); | 14862 inputPush(ctxt, stream); |
| 14863 return (xmlDoRead(ctxt, URL, encoding, options, 1)); | 14863 return (xmlDoRead(ctxt, URL, encoding, options, 1)); |
| 14864 } | 14864 } |
| 14865 | 14865 |
| 14866 #define bottom_parser | 14866 #define bottom_parser |
| 14867 #include "elfgcchack.h" | 14867 #include "elfgcchack.h" |
| OLD | NEW |