* xmlParseLookupGt: * @ctxt: an XML parser context * * Check whether there's enough data in the input buffer to finish parsing * a start tag. This has to take quotes into account. */
| 10886 | * a start tag. This has to take quotes into account. |
| 10887 | */ |
| 10888 | static int |
| 10889 | xmlParseLookupGt(xmlParserCtxtPtr ctxt) { |
| 10890 | const xmlChar *cur; |
| 10891 | const xmlChar *end = ctxt->input->end; |
| 10892 | int state = ctxt->endCheckState; |
| 10893 | size_t index; |
| 10894 | |
| 10895 | if (ctxt->checkIndex == 0) |
| 10896 | cur = ctxt->input->cur + 1; |
| 10897 | else |
| 10898 | cur = ctxt->input->cur + ctxt->checkIndex; |
| 10899 | |
| 10900 | while (cur < end) { |
| 10901 | if (state) { |
| 10902 | if (*cur == state) |
| 10903 | state = 0; |
| 10904 | } else if (*cur == '\'' || *cur == '"') { |
| 10905 | state = *cur; |
| 10906 | } else if (*cur == '>') { |
| 10907 | ctxt->checkIndex = 0; |
| 10908 | ctxt->endCheckState = 0; |
| 10909 | return(1); |
| 10910 | } |
| 10911 | cur++; |
| 10912 | } |
| 10913 | |
| 10914 | index = cur - ctxt->input->cur; |
| 10915 | if (index > LONG_MAX) { |
| 10916 | ctxt->checkIndex = 0; |
| 10917 | ctxt->endCheckState = 0; |
| 10918 | return(1); |
| 10919 | } |
| 10920 | ctxt->checkIndex = index; |
| 10921 | ctxt->endCheckState = state; |
| 10922 | return(0); |
| 10923 | } |
| 10924 | |
| 10925 | /** |
| 10926 | * xmlParseLookupInternalSubset: |