diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-06-03 01:27:27 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-06-03 01:27:27 +0800 |
commit | 3bf07b8693c59ce11edb1eff5e2ae301d1a66544 (patch) | |
tree | fb8ae3d6cbacb11e4189f11a4fdd5d2a5d573898 /mail/mail-local.c | |
parent | 1e93138b5499318ba0c7ebd4a8cebe63955ec42f (diff) | |
download | gsoc2013-evolution-3bf07b8693c59ce11edb1eff5e2ae301d1a66544.tar.gz gsoc2013-evolution-3bf07b8693c59ce11edb1eff5e2ae301d1a66544.tar.zst gsoc2013-evolution-3bf07b8693c59ce11edb1eff5e2ae301d1a66544.zip |
Stat the XML file before trying to parse it to make sure it exists.
2003-05-30 Jeffrey Stedfast <fejj@ximian.com>
* mail-local.c (load_metainfo): Stat the XML file before trying to
parse it to make sure it exists.
svn path=/trunk/; revision=21368
Diffstat (limited to 'mail/mail-local.c')
-rw-r--r-- | mail/mail-local.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mail/mail-local.c b/mail/mail-local.c index bf0271afb9..5db550d46d 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -136,15 +136,19 @@ static CamelType mail_local_folder_get_type (void); static struct _local_meta * load_metainfo(const char *path) { - xmlDocPtr doc; + xmlDocPtr doc = NULL; xmlNodePtr node; struct _local_meta *meta; - + struct stat st; + d(printf("Loading folder metainfo from : %s\n", path)); meta = g_malloc0(sizeof(*meta)); meta->path = g_strdup(path); - + + if (stat (path, &st) == -1 || !S_ISREG (st.st_mode)) + goto dodefault; + doc = xmlParseFile(path); if (doc == NULL) goto dodefault; |