diff options
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -4794,8 +4794,13 @@ xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk) { } NEXT; if (RAW == '?') { - if (ret != NULL) - ret->ocur = XML_ELEMENT_CONTENT_OPT; + if (ret != NULL) { + if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) || + (ret->ocur == XML_ELEMENT_CONTENT_MULT)) + ret->ocur = XML_ELEMENT_CONTENT_MULT; + else + ret->ocur = XML_ELEMENT_CONTENT_OPT; + } NEXT; } else if (RAW == '*') { if (ret != NULL) { @@ -4822,7 +4827,11 @@ xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk) { if (ret != NULL) { int found = 0; - ret->ocur = XML_ELEMENT_CONTENT_PLUS; + if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) || + (ret->ocur == XML_ELEMENT_CONTENT_MULT)) + ret->ocur = XML_ELEMENT_CONTENT_MULT; + else + ret->ocur = XML_ELEMENT_CONTENT_PLUS; /* * Some normalization: * (a | b*)+ == (a | b)* @@ -7580,7 +7589,7 @@ xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix, } SKIP(2); - if ((tlen > 0) && (memcmp(ctxt->input->cur, ctxt->name, tlen) == 0)) { + if ((tlen > 0) && (strncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) { if (ctxt->input->cur[tlen] == '>') { ctxt->input->cur += tlen + 1; goto done; |