[evolution-patches] Filter libxml spew



One more missing stat call. This was spewing a warning every time user
filters were loaded since I don't have any defined.

I figured I'd use stat instead of g_file_test since fejj has to approve
this one.

/me runs.

Mike
Index: filter/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/filter/ChangeLog,v
retrieving revision 1.369
diff -u -p -r1.369 ChangeLog
--- filter/ChangeLog	9 Jun 2003 18:17:10 -0000	1.369
+++ filter/ChangeLog	11 Jun 2003 13:23:01 -0000
@@ -1,3 +1,7 @@
+2003-06-11  Mike Kestner  <mkestner ximian com>
+
+	* rule-context.c (load): stat the user file before parsing.
+
 2003-06-06  Jeffrey Stedfast  <fejj ximian com>
 
 	Fixes some leaks from bug #43883.
Index: filter/rule-context.c
===================================================================
RCS file: /cvs/gnome/evolution/filter/rule-context.c,v
retrieving revision 1.48
diff -u -p -r1.48 rule-context.c
--- filter/rule-context.c	29 Apr 2003 17:08:40 -0000	1.48
+++ filter/rule-context.c	11 Jun 2003 13:23:01 -0000
@@ -290,6 +290,7 @@ load(RuleContext *rc, const char *system
 	xmlNodePtr set, rule, root;
 	struct _part_set_map *part_map;
 	struct _rule_set_map *rule_map;
+	struct stat st;
 	
 	rule_context_set_error(rc, NULL);
 	
@@ -310,7 +311,9 @@ load(RuleContext *rc, const char *system
 		return -1;
 	}
 	/* doesn't matter if this doens't exist */
-	rc->user = xmlParseFile(user);
+	rc->user = NULL;
+	if (stat (user, &st) != -1 && S_ISREG (st.st_mode))
+		rc->user = xmlParseFile(user);
 	
 	/* now parse structure */
 	/* get rule parts */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]