Fix weird streaming RelaxNG errors
For https://bugzilla.gnome.org/show_bug.cgi?id=512454
The bug was to use compiled determinitic automata when
the content model was found to be non-deterministic, leading
to random parsing errors.
diff --git a/relaxng.c b/relaxng.c
index f575287..18f6a0b 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -3059,8 +3059,8 @@
list = list->next;
}
xmlAutomataSetFinalState(ctxt->am, ctxt->state);
- def->contModel = xmlAutomataCompile(ctxt->am);
- xmlRegexpIsDeterminist(def->contModel);
+ if (xmlAutomataIsDeterminist(ctxt->am))
+ def->contModel = xmlAutomataCompile(ctxt->am);
xmlFreeAutomata(ctxt->am);
ctxt->state = oldstate;