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

fixed xmlFAParseCharRange for Unicode ranges with patch from Charles

* xmlregexp.c: fixed xmlFAParseCharRange for Unicode ranges
  with patch from Charles Bozeman.
This commit is contained in:
William M. Brack
2003-12-27 01:54:25 +00:00
parent 9887395b55
commit dc99df936c
2 changed files with 12 additions and 5 deletions

View File

@ -3533,7 +3533,7 @@ xmlFAParseCharRef(xmlRegParserCtxtPtr ctxt) {
*/
static void
xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
int cur;
int cur, len;
int start = -1;
int end = -1;
@ -3560,13 +3560,14 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
return;
}
end = start;
len = 1;
} else if ((cur != 0x5B) && (cur != 0x5D)) {
end = start = cur;
end = start = CUR_SCHAR(ctxt->cur, len);
} else {
ERROR("Expecting a char range");
return;
}
NEXT;
NEXTL(len);
if (start == '-') {
return;
}
@ -3593,13 +3594,14 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
ERROR("Invalid escape value");
return;
}
len = 1;
} else if ((cur != 0x5B) && (cur != 0x5D)) {
end = cur;
end = CUR_SCHAR(ctxt->cur, len);
} else {
ERROR("Expecting the end of a char range");
return;
}
NEXT;
NEXTL(len);
/* TODO check that the values are acceptable character ranges for XML */
if (end < start) {
ERROR("End of range is before start of range");