diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-05-17 02:27:37 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-05-17 02:27:37 +0800 |
commit | 26793306879d948417f52f6cfbd1a8176459e783 (patch) | |
tree | 168533fdd588e598258f5d0b58ee09561f6af021 /widgets | |
parent | 0454e4c493c645ca57a33b68cb55c49f0ddad1ff (diff) | |
download | gsoc2013-evolution-26793306879d948417f52f6cfbd1a8176459e783.tar.gz gsoc2013-evolution-26793306879d948417f52f6cfbd1a8176459e783.tar.zst gsoc2013-evolution-26793306879d948417f52f6cfbd1a8176459e783.zip |
Make sure the galview.xml file exists before trying to parse it with
2003-05-16 Jeffrey Stedfast <fejj@ximian.com>
* gal-view-collection.c (load_single_dir): Make sure the
galview.xml file exists before trying to parse it with
xmlParseFile() to avoid warning spewage from libxml2.
svn path=/trunk/; revision=21219
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/menus/gal-view-collection.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 49339f4473..4ac0ae68dd 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -24,6 +24,7 @@ #include <config.h> #include <util/e-i18n.h> +#include <sys/stat.h> #include <ctype.h> #include <string.h> #include <errno.h> @@ -384,13 +385,16 @@ load_single_dir (GalViewCollection *collection, char *dir, gboolean local) { - xmlDoc *doc; + xmlDoc *doc = NULL; xmlNode *root; xmlNode *child; char *filename = g_concat_dir_and_file(dir, "galview.xml"); char *default_view; - - doc = xmlParseFile(filename); + struct stat st; + + if (stat (filename, &st) != -1 && S_ISREG (st.st_mode)) + doc = xmlParseFile (filename); + if (!doc) { g_free (filename); return; |