aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-06-21 19:30:51 +0800
committerChristian Persch <chpe@src.gnome.org>2004-06-21 19:30:51 +0800
commit73416d200f6a1ccce28781321bc670acf83a858d (patch)
tree032f5735f82fddfc53b6082f8df63fd4ca7e5351
parente6d35d8000a1edc16d074e7547a4cfc9d9a0d3eb (diff)
downloadgsoc2013-epiphany-73416d200f6a1ccce28781321bc670acf83a858d.tar
gsoc2013-epiphany-73416d200f6a1ccce28781321bc670acf83a858d.tar.gz
gsoc2013-epiphany-73416d200f6a1ccce28781321bc670acf83a858d.tar.bz2
gsoc2013-epiphany-73416d200f6a1ccce28781321bc670acf83a858d.tar.lz
gsoc2013-epiphany-73416d200f6a1ccce28781321bc670acf83a858d.tar.xz
gsoc2013-epiphany-73416d200f6a1ccce28781321bc670acf83a858d.tar.zst
gsoc2013-epiphany-73416d200f6a1ccce28781321bc670acf83a858d.zip
Check for empty attributes before adding the item when parsing the
2004-06-21 Christian Persch <chpe@cvs.gnome.org> * lib/egg/egg-toolbars-model.c: (parse_item_list): Check for empty attributes before adding the item when parsing the toolbars file. Should fix bug #144698
-rw-r--r--ChangeLog7
-rwxr-xr-xlib/egg/egg-toolbars-model.c17
2 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 18b9c833b..d12c625e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2004-06-21 Christian Persch <chpe@cvs.gnome.org>
+ * lib/egg/egg-toolbars-model.c: (parse_item_list):
+
+ Check for empty attributes before adding the item when parsing
+ the toolbars file. Should fix bug #144698
+
+2004-06-21 Christian Persch <chpe@cvs.gnome.org>
+
* src/bookmarks/ephy-bookmarks-import.c: (ephy_bookmarks_import):
Allow importing from Epiphany bookmarks format (RDF),
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index 0da5cbd69..0e308c472 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -361,17 +361,20 @@ parse_item_list (EggToolbarsModel *t,
type = xmlGetProp (child, "type");
if (type == NULL)
{
- type = g_strdup (EGG_TOOLBAR_ITEM_TYPE);
+ type = xmlStrdup (EGG_TOOLBAR_ITEM_TYPE);
}
- id = egg_toolbars_model_get_item_id (t, type, name);
- if (id != NULL)
+ if (name != NULL && name[0] != '\0' && type != NULL)
{
- egg_toolbars_model_add_item (t, position, -1, id, type);
- }
+ id = egg_toolbars_model_get_item_id (t, type, name);
+ if (id != NULL)
+ {
+ egg_toolbars_model_add_item (t, position, -1, id, type);
+ }
+ g_free (id);
+ }
xmlFree (name);
- g_free (type);
- g_free (id);
+ xmlFree (type);
}
else if (xmlStrEqual (child->name, "separator"))
{