diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-04-25 00:46:50 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-04-25 00:46:50 +0800 |
commit | 960163b188ae63f7696c1222164d3aeffd67f5eb (patch) | |
tree | fe87dcce455af27ae27d8ef6cbffa071cd8b2ee3 | |
parent | cebc10e46e945a8d691592e2de14371fe66fc576 (diff) | |
download | gsoc2013-evolution-960163b188ae63f7696c1222164d3aeffd67f5eb.tar.gz gsoc2013-evolution-960163b188ae63f7696c1222164d3aeffd67f5eb.tar.zst gsoc2013-evolution-960163b188ae63f7696c1222164d3aeffd67f5eb.zip |
Try stat'ing the file before loading it with xmlParseFile() to avoid
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.
svn path=/trunk/; revision=20955
-rw-r--r-- | widgets/menus/gal-view-instance.c | 10 |
1 files changed, 6 insertions, 4 deletions
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)); |