[glib/glib-2-58: 19/21] gmarkup: Fix validation of element names
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-58: 19/21] gmarkup: Fix validation of element names
- Date: Tue, 6 Nov 2018 13:11:25 +0000 (UTC)
commit 97674cceeba85ae0d4dec3cd85bb3442425cf091
Author: Philip Withnall <withnall endlessm com>
Date: Fri Oct 26 23:21:46 2018 +1300
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>
glib/gmarkup.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/glib/gmarkup.c b/glib/gmarkup.c
index f97a2c7c4..4169cb148 100644
--- a/glib/gmarkup.c
+++ b/glib/gmarkup.c
@@ -1051,8 +1051,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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]