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 | |
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
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/mail-local.c | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 18ae2e00af..567c5057f2 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +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. + 2003-05-29 Not Zed <NotZed@Ximian.com> * Makefile.am (BUILT_SOURCES): added server_DATA (*.server) so 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; |