diff options
author | Mike Hommey <glandium@debian.org> | 2009-03-01 10:53:23 +0100 |
---|---|---|
committer | Mike Hommey <glandium@debian.org> | 2009-03-01 10:53:23 +0100 |
commit | d03a853bb0370d89552eceee59df1746da4a37f8 (patch) | |
tree | 441802d52ac5c0a2b6929e6dd5d8a58210b0fe3a /xmlregexp.c | |
parent | 88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d (diff) | |
download | libxml2-d03a853bb0370d89552eceee59df1746da4a37f8.tar.gz |
Import upstream version 2.7.0upstream/2.7.0.dfsg
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; |