[evolution-patches] suppress warnings from libxml in mail-local.c
- From: Jeffrey Stedfast <fejj ximian com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] suppress warnings from libxml in mail-local.c
- Date: 30 May 2003 14:11:22 -0400
just stat the file to make sure it exists before having libxml parse it.
Jeff
--
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com - www.ximian.com
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2738
diff -u -r1.2738 ChangeLog
--- ChangeLog 27 May 2003 23:39:43 -0000 1.2738
+++ ChangeLog 30 May 2003 17:55:44 -0000
@@ -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-27 Not Zed <NotZed Ximian com>
* message-tag-editor.c (message_tag_editor_init): set the default
Index: mail-local.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-local.c,v
retrieving revision 1.131
diff -u -r1.131 mail-local.c
--- mail-local.c 14 May 2003 18:47:11 -0000 1.131
+++ mail-local.c 30 May 2003 17:55:45 -0000
@@ -136,15 +136,19 @@
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]