changeset 4439:7693d84255e7

[gaim-migrate @ 4714] die correctly (i.e. not silently) on invalid XML in the buddy list. hopefully this will let us figure out the problems people are having committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 28 Jan 2003 03:47:22 +0000
parents 2054d8429925
children d9e4eacf6b46
files src/list.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/list.c	Tue Jan 28 02:45:34 2003 +0000
+++ b/src/list.c	Tue Jan 28 03:47:22 2003 +0000
@@ -751,6 +751,7 @@
 	BLIST_TAG_BLOCK,
 	BLIST_TAG_IGNORE
 } blist_parser_current_tag;
+static gboolean blist_parser_error_occurred = FALSE;
 
 static void blist_start_element_handler (GMarkupParseContext *context,
 		const gchar *element_name,
@@ -917,12 +918,18 @@
 	}
 }
 
+static void blist_error_handler(GMarkupParseContext *context, GError *error,
+		gpointer user_data) {
+	blist_parser_error_occurred = TRUE;
+	debug_printf("error parsing blist.xml: %s\n", error->message);
+}
+
 static GMarkupParser blist_parser = {
 	blist_start_element_handler,
 	blist_end_element_handler,
 	blist_text_handler,
 	NULL,
-	NULL
+	blist_error_handler
 };
 
 static gboolean gaim_blist_read(const char *filename) {
@@ -950,6 +957,9 @@
 	}
 
 	g_markup_parse_context_free(context);
+	if(blist_parser_error_occurred)
+		return FALSE;
+
 	return TRUE;
 }