1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

Fix Schema determinism check of ##other namespaces

Non-compound (##local) and compound string atoms are always disjoint
regardless of whether the compound atom is negated (##other).

Closes #40.
This commit is contained in:
Nick Wellnhofer
2019-09-16 15:36:02 +02:00
parent 4e326a3aa9
commit e8c9cd5c7a
5 changed files with 26 additions and 3 deletions

View File

@ -2528,9 +2528,18 @@ xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
case XML_REGEXP_STRING:
if (!deep)
ret = (atom1->valuep != atom2->valuep);
else
ret = xmlRegStrEqualWildcard((xmlChar *)atom1->valuep,
(xmlChar *)atom2->valuep);
else {
xmlChar *val1 = (xmlChar *)atom1->valuep;
xmlChar *val2 = (xmlChar *)atom2->valuep;
int compound1 = (xmlStrchr(val1, '|') != NULL);
int compound2 = (xmlStrchr(val2, '|') != NULL);
/* Ignore negative match flag for ##other namespaces */
if (compound1 != compound2)
return(0);
ret = xmlRegStrEqualWildcard(val1, val2);
}
break;
case XML_REGEXP_EPSILON:
goto not_determinist;