1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

enhanced the logic of parsing char groups to better handle initial or

* xmlregexp.c: enhanced the logic of parsing char groups to
  better handle initial or ending '-' (bug 135972)
This commit is contained in:
William M. Brack
2004-03-20 14:51:25 +00:00
parent 236c8c09f0
commit 10f1ef4ce8
2 changed files with 9 additions and 8 deletions

View File

@ -1,3 +1,8 @@
Sat Mar 20 22:25:18 HKT 2004 William Brack <wbrack@mmm.com.hk>
* xmlregexp.c: enhanced the logic of parsing char groups to
better handle initial or ending '-' (bug 135972)
Sat Mar 20 19:26:03 HKT 2004 William Brack <wbrack@mmm.com.hk> Sat Mar 20 19:26:03 HKT 2004 William Brack <wbrack@mmm.com.hk>
* relaxng.c: added check for external reference in * relaxng.c: added check for external reference in

View File

@ -3572,7 +3572,7 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
return; return;
} }
cur = CUR; cur = CUR;
if (cur != '-') { if ((cur != '-') || (NXT(1) == ']')) {
xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg, xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
XML_REGEXP_CHARVAL, start, end, NULL); XML_REGEXP_CHARVAL, start, end, NULL);
return; return;
@ -3650,15 +3650,11 @@ xmlFAParseCharGroup(xmlRegParserCtxtPtr ctxt) {
ctxt->neg = !ctxt->neg; ctxt->neg = !ctxt->neg;
xmlFAParsePosCharGroup(ctxt); xmlFAParsePosCharGroup(ctxt);
ctxt->neg = neg; ctxt->neg = neg;
} else if (CUR == '-') { } else if ((CUR == '-') && (NXT(1) == '[')) {
int neg = ctxt->neg; int neg = ctxt->neg;
NEXT;
ctxt->neg = 2; ctxt->neg = 2;
if (CUR != '[') { NEXT; /* eat the '-' */
ERROR("charClassExpr: '[' expected"); NEXT; /* eat the '[' */
break;
}
NEXT;
xmlFAParseCharGroup(ctxt); xmlFAParseCharGroup(ctxt);
if (CUR == ']') { if (CUR == ']') {
NEXT; NEXT;