diff options
Diffstat (limited to 'xmlregexp.c')
-rw-r--r-- | xmlregexp.c | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/xmlregexp.c b/xmlregexp.c index 389453b..73598a5 100644 --- a/xmlregexp.c +++ b/xmlregexp.c @@ -3162,7 +3162,8 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) { exec->counts = NULL; while ((exec->status == 0) && ((exec->inputString[exec->index] != 0) || - (exec->state->type != XML_REGEXP_FINAL_STATE))) { + ((exec->state != NULL) && + (exec->state->type != XML_REGEXP_FINAL_STATE)))) { xmlRegTransPtr trans; xmlRegAtomPtr atom; @@ -4906,64 +4907,6 @@ xmlFAParseCharClassEsc(xmlRegParserCtxtPtr ctxt) { } /** - * xmlFAParseCharRef: - * @ctxt: a regexp parser context - * - * [19] XmlCharRef ::= ( '&#' [0-9]+ ';' ) | (' &#x' [0-9a-fA-F]+ ';' ) - */ -static int -xmlFAParseCharRef(xmlRegParserCtxtPtr ctxt) { - int ret = 0, cur; - - if ((CUR != '&') || (NXT(1) != '#')) - return(-1); - NEXT; - NEXT; - cur = CUR; - if (cur == 'x') { - NEXT; - cur = CUR; - if (((cur >= '0') && (cur <= '9')) || - ((cur >= 'a') && (cur <= 'f')) || - ((cur >= 'A') && (cur <= 'F'))) { - while (((cur >= '0') && (cur <= '9')) || - ((cur >= 'a') && (cur <= 'f')) || - ((cur >= 'A') && (cur <= 'F'))) { - if ((cur >= '0') && (cur <= '9')) - ret = ret * 16 + cur - '0'; - else if ((cur >= 'a') && (cur <= 'f')) - ret = ret * 16 + 10 + (cur - 'a'); - else - ret = ret * 16 + 10 + (cur - 'A'); - NEXT; - cur = CUR; - } - } else { - ERROR("Char ref: expecting [0-9A-F]"); - return(-1); - } - } else { - if ((cur >= '0') && (cur <= '9')) { - while ((cur >= '0') && (cur <= '9')) { - ret = ret * 10 + cur - '0'; - NEXT; - cur = CUR; - } - } else { - ERROR("Char ref: expecting [0-9]"); - return(-1); - } - } - if (cur != ';') { - ERROR("Char ref: expecting ';'"); - return(-1); - } else { - NEXT; - } - return(ret); -} - -/** * xmlFAParseCharRange: * @ctxt: a regexp parser context * @@ -4984,12 +4927,6 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) { return; } - if ((CUR == '&') && (NXT(1) == '#')) { - end = start = xmlFAParseCharRef(ctxt); - xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg, - XML_REGEXP_CHARVAL, start, end, NULL); - return; - } cur = CUR; if (cur == '\\') { NEXT; |