aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-10-03 17:42:36 +0800
committerChristian Persch <chpe@src.gnome.org>2003-10-03 17:42:36 +0800
commit7380af31d66ee0e94e521123e03a68e67d9bcbd9 (patch)
treef90abfe320fad33abf7348ab97edd7153386bc06 /lib
parentcd0e1615fc4afa03dc92fd693912a3ed58ffbede (diff)
downloadgsoc2013-epiphany-7380af31d66ee0e94e521123e03a68e67d9bcbd9.tar
gsoc2013-epiphany-7380af31d66ee0e94e521123e03a68e67d9bcbd9.tar.gz
gsoc2013-epiphany-7380af31d66ee0e94e521123e03a68e67d9bcbd9.tar.bz2
gsoc2013-epiphany-7380af31d66ee0e94e521123e03a68e67d9bcbd9.tar.lz
gsoc2013-epiphany-7380af31d66ee0e94e521123e03a68e67d9bcbd9.tar.xz
gsoc2013-epiphany-7380af31d66ee0e94e521123e03a68e67d9bcbd9.tar.zst
gsoc2013-epiphany-7380af31d66ee0e94e521123e03a68e67d9bcbd9.zip
Check for failed load of the toolbars model from the XML file, and fix the
2003-10-03 Christian Persch <chpe@cvs.gnome.org> * lib/egg/egg-toolbars-model.c: (safe_save_xml), (egg_toolbars_model_load): Check for failed load of the toolbars model from the XML file, and fix the check for failed save of same to the XML file.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/egg/egg-toolbars-model.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index 60423b8b7..d9c3ab832 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -146,7 +146,7 @@ safe_save_xml (const char *xml_file, xmlDocPtr doc)
tmp_file = g_strconcat (xml_file, ".tmp", NULL);
old_file = g_strconcat (xml_file, ".old", NULL);
- if (!xmlSaveFormatFile (tmp_file, doc, 1))
+ if (xmlSaveFormatFile (tmp_file, doc, 1) <= 0)
{
g_warning ("Failed to write XML data to %s", tmp_file);
goto failed;
@@ -433,6 +433,11 @@ egg_toolbars_model_load (EggToolbarsModel *t,
g_return_if_fail (IS_EGG_TOOLBARS_MODEL (t));
doc = xmlParseFile (xml_file);
+ if (doc == NULL)
+ {
+ g_warning ("Failed to load XML data from %s", xml_file);
+ return;
+ }
root = xmlDocGetRootElement (doc);
t->priv->toolbars = g_node_new (NULL);