diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-10-17 20:47:15 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-10-17 20:47:15 +0800 |
commit | d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c (patch) | |
tree | 9a1ad6c710f67fcd5a9bb60352379ef0bfe13222 | |
parent | 72b6ced349fb6e60dc893aae077efbe75781aef0 (diff) | |
download | gsoc2013-empathy-d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c.tar gsoc2013-empathy-d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c.tar.gz gsoc2013-empathy-d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c.tar.bz2 gsoc2013-empathy-d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c.tar.lz gsoc2013-empathy-d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c.tar.xz gsoc2013-empathy-d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c.tar.zst gsoc2013-empathy-d7cc75bc0653c9862dab7c16ebe1a82d2fb9da1c.zip |
Check whether ~/.purple/accounts.xml is readable before trying to read it. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1620
-rw-r--r-- | src/empathy-import-dialog.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 <gtk/gtk.h> #include <glade/glade.h> #include <glib/gi18n.h> +#include <glib/gstdio.h> #include <libxml/parser.h> #include <libxml/tree.h> @@ -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; } |