[evolution-patches] gal-view warning spewage suppression patch



gets rid of the annoying "failed to load external entity" foo warnings
from libxml when passed a path that doesn't exist.

Jeff

-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
? gal-view-warnings.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/gal/menus/ChangeLog,v
retrieving revision 1.63
diff -u -r1.63 ChangeLog
--- ChangeLog	15 Apr 2003 21:37:46 -0000	1.63
+++ ChangeLog	23 Apr 2003 20:17:38 -0000
@@ -1,3 +1,9 @@
+2003-04-23  Jeffrey Stedfast  <fejj ximian com>
+
+	* gal-view-instance.c (load_current_view): Try stat'ing the file
+	before loading it with xmlParseFile() to avoid warnign spewage
+	from libxml2 saying that the file doesn't exist.
+
 2003-04-15  Hans Petter Jansson  <hpj ximian com>
 
 	* gal-view-instance.c (gal_view_instance_get_popup_menu): Free the
Index: gal-view-instance.c
===================================================================
RCS file: /cvs/gnome/gal/gal/menus/gal-view-instance.c,v
retrieving revision 1.13
diff -u -r1.13 gal-view-instance.c
--- gal-view-instance.c	15 Apr 2003 21:37:46 -0000	1.13
+++ gal-view-instance.c	23 Apr 2003 20:17:41 -0000
@@ -242,9 +242,13 @@
 	xmlDoc *doc;
 	xmlNode *root;
 	GalView *view = NULL;
-
-	doc = xmlParseFile(instance->current_view_filename);
-
+	struct stat st;
+	
+	if (stat (instance->current_view_filename, &st) != -1 && S_ISREG (st.st_mode))
+		doc = xmlParseFile(instance->current_view_filename);
+	else
+		doc = NULL;
+	
 	if (doc == NULL) {
 		instance->current_id = g_strdup (gal_view_instance_get_default_view (instance));
 


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