[gtk/wip/baedert/for-master] sdf
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] sdf
- Date: Fri, 10 Apr 2020 15:07:28 +0000 (UTC)
commit 640ec32733d2a755e92a9ec4b5d4a955ecbc2237
Author: Timm Bäder <mail baedert org>
Date: Fri Apr 10 16:23:32 2020 +0200
sdf
gtk/gtklabel.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 4a8279bd77..a396c815c6 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2219,8 +2219,7 @@ parse_uri_markup (GtkLabel *label,
GError **error)
{
GMarkupParseContext *context = NULL;
- const gchar *p, *end;
- gboolean needs_root = TRUE;
+ const char *p, *end;
gsize length;
UriParserData pdata;
@@ -2236,22 +2235,21 @@ parse_uri_markup (GtkLabel *label,
while (p != end && xml_isspace (*p))
p++;
- if (end - p >= 8 && strncmp (p, "<markup>", 8) == 0)
- needs_root = FALSE;
-
context = g_markup_parse_context_new (&markup_parser, 0, &pdata, NULL);
- if (needs_root)
+ if (end - p >= 8 && strncmp (p, "<markup>", 8) == 0)
{
- if (!g_markup_parse_context_parse (context, "<markup>", -1, error))
+ if (!g_markup_parse_context_parse (context, str, length, error))
goto failed;
}
+ else
+ {
+ if (!g_markup_parse_context_parse (context, "<markup>", -1, error))
+ goto failed;
- if (!g_markup_parse_context_parse (context, str, length, error))
- goto failed;
+ if (!g_markup_parse_context_parse (context, str, length, error))
+ goto failed;
- if (needs_root)
- {
if (!g_markup_parse_context_parse (context, "</markup>", -1, error))
goto failed;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]