diff --git a/ChangeLog b/ChangeLog index c5205b5f..43dd4b31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Feb 12 13:41:16 CET 2004 Daniel Veillard + + * 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 * parser.c: fixed bug #132575 about finding the end of the diff --git a/result/schemas/all1_0_0 b/result/schemas/all1_0_0 new file mode 100644 index 00000000..327cec7d --- /dev/null +++ b/result/schemas/all1_0_0 @@ -0,0 +1 @@ +./test/schemas/all1_0.xml validates diff --git a/result/schemas/all1_0_0.err b/result/schemas/all1_0_0.err new file mode 100644 index 00000000..e69de29b diff --git a/test/schemas/all1_0.xml b/test/schemas/all1_0.xml new file mode 100644 index 00000000..f50088c6 --- /dev/null +++ b/test/schemas/all1_0.xml @@ -0,0 +1,4 @@ + + + + diff --git a/test/schemas/all1_0.xsd b/test/schemas/all1_0.xsd new file mode 100644 index 00000000..28fee0eb --- /dev/null +++ b/test/schemas/all1_0.xsd @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/xmlregexp.c b/xmlregexp.c index 08b51d8a..1706c740 100644 --- a/xmlregexp.c +++ b/xmlregexp.c @@ -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)