From 73683f2ee7f255e05a1cbfd7f2caead606108614 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Mon, 26 Mar 2012 20:04:51 +0000 Subject: [PATCH] Melhorando mensagem de erro no processamento do xml, incluindo teste por atributo invalido --- src/gtk/actions.c | 3 +++ src/gtk/uiparser/parsefile.c | 2 +- ui/00default.xml | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gtk/actions.c b/src/gtk/actions.c index 2b6fd82..b249198 100644 --- a/src/gtk/actions.c +++ b/src/gtk/actions.c @@ -270,6 +270,9 @@ static int id_from_array(const gchar *key, const gchar **array, GError **error) { int f; + if(!key) + return -1; + for(f = 0;array[f];f++) { if(!g_strcasecmp(key,array[f])) diff --git a/src/gtk/uiparser/parsefile.c b/src/gtk/uiparser/parsefile.c index e29c685..a8e1890 100644 --- a/src/gtk/uiparser/parsefile.c +++ b/src/gtk/uiparser/parsefile.c @@ -312,7 +312,7 @@ trace("%s ----",__FUNCTION__); return -1; } - context = g_markup_parse_context_new(&parser,G_MARKUP_TREAT_CDATA_AS_TEXT,info,NULL); + context = g_markup_parse_context_new(&parser,G_MARKUP_TREAT_CDATA_AS_TEXT|G_MARKUP_PREFIX_ERROR_POSITION,info,NULL); if(!g_markup_parse_context_parse(context,text,strlen(text),&error)) { diff --git a/ui/00default.xml b/ui/00default.xml index 76b29ef..5492118 100644 --- a/ui/00default.xml +++ b/ui/00default.xml @@ -152,9 +152,9 @@ - - - + + + -- libgit2 0.21.2