[ADD/WIP] Editing support XMPP->Matrix

This commit is contained in:
LDA 2024-06-25 17:20:00 +02:00
commit ae740878c8
13 changed files with 249 additions and 106 deletions

View file

@ -137,7 +137,7 @@ XMLookForTKV(XMLElement *parent, char *tag, char *k, char *v)
{
size_t i;
if (!parent || !tag || !k || !v)
if (!parent || !k || !v)
{
return NULL;
}
@ -147,9 +147,12 @@ XMLookForTKV(XMLElement *parent, char *tag, char *k, char *v)
XMLElement *child = ArrayGet(parent->children, i);
HashMap *attrs = child->attrs;
char *value = HashMapGet(attrs, k);
if (StrEquals(child->name, tag) && StrEquals(value, v))
if (StrEquals(child->name, tag) || !tag)
{
return child;
if (StrEquals(value, v))
{
return child;
}
}
}

View file

@ -730,12 +730,14 @@ XMLParseAttQuote(XMLexer *lexer)
char *code = NULL;
int c2;
int p2 = XMLInitialiseBuffer(lexer);
while ((c2 = XMLGetc(lexer)) && c2 != EOF)
int j = 0;
while ((c2 = XMLGetc(lexer)) && c2 != EOF && j < 8)
{
if (c2 == ';')
{
break;
}
j++;
}
if (c2 != ';')
{
@ -775,12 +777,14 @@ XMLParseAttDouble(XMLexer *lexer)
char *code = NULL;
int c2;
int p2 = XMLInitialiseBuffer(lexer);
while ((c2 = XMLGetc(lexer)) && c2 != EOF)
int j = 0;
while ((c2 = XMLGetc(lexer)) && c2 != EOF && j < 8)
{
if (c2 == ';')
{
break;
}
j++;
}
if (c2 != ';')
{