From d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Fri, 17 Oct 2008 12:47:15 +0000 Subject: Check whether ~/.purple/accounts.xml is readable before trying to read it. (Jonny Lamb) Signed-off-by: Jonny Lamb svn path=/trunk/; revision=1620 --- src/empathy-import-dialog.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/empathy-import-dialog.c b/src/empathy-import-dialog.c index e726e1e3c..ad90a8e17 100644 --- a/src/empathy-import-dialog.c +++ b/src/empathy-import-dialog.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -284,8 +285,11 @@ import_dialog_pidgin_load (void) ctxt = xmlNewParserCtxt (); filename = g_build_filename (g_get_home_dir (), ".purple", "accounts.xml", NULL); + + if (g_access (filename, R_OK) != 0) + goto FILENAME; + doc = xmlCtxtReadFile (ctxt, filename, NULL, 0); - g_free (filename); rootnode = xmlDocGetRootElement (doc); if (rootnode == NULL) @@ -408,6 +412,9 @@ OUT: xmlFreeDoc(doc); xmlFreeParserCtxt (ctxt); +FILENAME: + g_free (filename); + return accounts; } -- cgit v1.2.3