From 960163b188ae63f7696c1222164d3aeffd67f5eb Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 24 Apr 2003 16:46:50 +0000 Subject: Try stat'ing the file before loading it with xmlParseFile() to avoid 2003-04-23 Jeffrey Stedfast * 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. svn path=/trunk/; revision=20955 --- widgets/menus/gal-view-instance.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'widgets/menus') diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index 85bda1ba6f..67293eae6a 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -239,12 +239,14 @@ collection_changed (GalView *view, GalViewInstance *instance) static void load_current_view (GalViewInstance *instance) { - xmlDoc *doc; + xmlDoc *doc = NULL; 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); + if (doc == NULL) { instance->current_id = g_strdup (gal_view_instance_get_default_view (instance)); -- cgit v1.2.3