gmarkup: Fix validation of element names

Previously, the element name validation only happened if a start_element
callback was specified on the context. Element name validation should be
unconditional.

This was causing test-5.gmarkup to fail when run against the improved
tests in the following commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2018-10-26 23:21:46 +13:00
parent 3a961236dd
commit 2187b1bec4

View File

@ -1050,8 +1050,10 @@ emit_start_element (GMarkupParseContext *context,
tmp_error = NULL;
start_name = current_element (context);
if (context->parser->start_element &&
name_validate (context, start_name, error))
if (!name_validate (context, start_name, error))
return;
if (context->parser->start_element)
(* context->parser->start_element) (context,
start_name,
(const gchar **)attr_names,