1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

fixing bug #132930 with the provided patch, a bit suspicious about it but

* xmlregexp.c: fixing bug #132930 with the provided patch, a bit
  suspicious about it but this is fairly contained and regression
  tests still passes.
* test/schemas/all1* result/schemas/all1*: added the test to
  the regression suite.
Daniel
This commit is contained in:
Daniel Veillard 2004-02-12 12:43:49 +00:00
parent 036143bb53
commit 0ddb21c46c
6 changed files with 39 additions and 3 deletions

View File

@ -1,3 +1,11 @@
Thu Feb 12 13:41:16 CET 2004 Daniel Veillard <daniel@veillard.com>
* xmlregexp.c: fixing bug #132930 with the provided patch, a bit
suspicious about it but this is fairly contained and regression
tests still passes.
* test/schemas/all1* result/schemas/all1*: added the test to
the regression suite.
Thu Feb 12 12:54:26 CET 2004 Daniel Veillard <daniel@veillard.com>
* parser.c: fixed bug #132575 about finding the end of the

1
result/schemas/all1_0_0 Normal file
View File

@ -0,0 +1 @@
./test/schemas/all1_0.xml validates

View File

4
test/schemas/all1_0.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<a>
<b/>
</a>

10
test/schemas/all1_0.xsd Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="A">
<xs:all>
<xs:element name="b" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:element name="a" type="A"/>
</xs:schema>

View File

@ -4325,6 +4325,7 @@ xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
xmlAutomataStatePtr to, const xmlChar *token,
int min, int max, void *data) {
xmlRegAtomPtr atom;
int counter;
if ((am == NULL) || (from == NULL) || (token == NULL))
return(NULL);
@ -4343,10 +4344,22 @@ xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
atom->min = min;
atom->max = max;
if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
xmlRegFreeAtom(atom);
return(NULL);
/*
* associate a counter to the transition.
*/
counter = xmlRegGetCounter(am);
am->counters[counter].min = min;
am->counters[counter].max = max;
/* xmlFAGenerateTransitions(am, from, to, atom); */
if (to == NULL) {
to = xmlRegNewState(am);
xmlRegStatePush(am, to);
}
xmlRegStateAddTrans(am, from, atom, to, counter, -1);
xmlRegAtomPush(am, atom);
am->state = to;
if (to == NULL)
to = am->state;
if (to == NULL)