Re: [xml] Schema validation bug



It looks like I was able to fix it and even didn't break anything else.
I hope.

Probably it's not the best solution, but may be someone, who understands it better will be able to do a better fix sometime.

Regards,
Alexey Sarytchev

PS.

Here is the path:

==== libxml2/xmlregexp.c - libxml2/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)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]