From: Vsevolod Stakhov Date: Tue, 12 Nov 2013 15:08:14 +0000 (+0000) Subject: Fix elements in xml config. X-Git-Tag: 0.6.0~74 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=969546a4e5c9c0c17cabf6063cfcb49e19d43974;p=rspamd.git Fix elements in xml config. --- diff --git a/src/cfg_xml.c b/src/cfg_xml.c index 9c60d8a7f..c183e6209 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -876,13 +876,17 @@ rspamd_xml_end_element (GMarkupParseContext *context, const gchar *element_name, if (g_ascii_strcasecmp (ud->section_name[ud->nested - 1], element_name) == 0) { ud->nested --; } + else if (g_ascii_strcasecmp (element_name, "param") == 0) { + /* Another ugly hack */ + ud->nested --; + } else if (g_ascii_strcasecmp (ud->section_name[ud->nested], element_name) != 0) { - *error = g_error_new (xml_error_quark (), XML_EXTRA_ELEMENT, "element %s is umatched", element_name); + *error = g_error_new (xml_error_quark (), XML_EXTRA_ELEMENT, "element %s is unmatched", element_name); ud->state = XML_ERROR; } } else if (g_ascii_strcasecmp ("rspamd", element_name) != 0) { - *error = g_error_new (xml_error_quark (), XML_EXTRA_ELEMENT, "element %s is umatched on the top level", element_name); + *error = g_error_new (xml_error_quark (), XML_EXTRA_ELEMENT, "element %s is unmatched on the top level", element_name); ud->state = XML_ERROR; } }