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
diff --git a/ChangeLog b/ChangeLog
index c5205b5..43dd4b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/result/schemas/all1_0_0 b/result/schemas/all1_0_0
new file mode 100644
index 0000000..327cec7
--- /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 0000000..e69de29
--- /dev/null
+++ b/result/schemas/all1_0_0.err
diff --git a/test/schemas/all1_0.xml b/test/schemas/all1_0.xml
new file mode 100644
index 0000000..f50088c
--- /dev/null
+++ b/test/schemas/all1_0.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<a>
+ <b/>
+</a>
diff --git a/test/schemas/all1_0.xsd b/test/schemas/all1_0.xsd
new file mode 100644
index 0000000..28fee0e
--- /dev/null
+++ b/test/schemas/all1_0.xsd
@@ -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>
diff --git a/xmlregexp.c b/xmlregexp.c
index 08b51d8..1706c74 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -4325,6 +4325,7 @@
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 @@
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)