aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--src/ephy-extensions-manager.c47
2 files changed, 35 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 96785a77c..f3fe946f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-23 Crispin Flowerday <gnome@flowerday.cx>
+
+ * src/ephy-extensions-manager.c:
+ (ephy_extensions_manager_load_ini_string):
+
+ Don't crash if the Authors key is missing, or
+ there are no keys in the Loader section
+
2005-09-23 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-extensions-manager.c:
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c
index e571859ff..5eaf35801 100644
--- a/src/ephy-extensions-manager.c
+++ b/src/ephy-extensions-manager.c
@@ -711,13 +711,17 @@ ephy_extensions_manager_load_ini_string (EphyExtensionsManager *manager,
list = g_key_file_get_string_list (key_file,
"Epiphany Extension",
"Authors", NULL, NULL);
- for (i = 0 ; list[i]; i++ )
+ if (list)
{
- einfo->authors = g_list_prepend (einfo->authors,
- g_strstrip (g_strdup (list[i])));
+ for (i = 0 ; list[i]; i++ )
+ {
+ einfo->authors = g_list_prepend (einfo->authors,
+ g_strstrip (g_strdup (list[i])));
+ }
+ g_strfreev (list);
}
+
einfo->authors = g_list_reverse (einfo->authors);
- g_strfreev (list);
info->version = g_key_file_get_integer (key_file,
"Epiphany Extension",
@@ -725,28 +729,31 @@ ephy_extensions_manager_load_ini_string (EphyExtensionsManager *manager,
/* Load the loader flags */
list = g_key_file_get_keys (key_file, "Loader", NULL, NULL);
- for (i = 0 ; list[i]; i++ )
+
+ if (list)
{
-
- char * value;
- GQuark attr_quark = 0;
+ for (i = 0 ; list[i]; i++ )
+ {
+ char * value;
+ GQuark attr_quark = 0;
- value = g_key_file_get_string (key_file, "Loader",
- list[i], NULL);
+ value = g_key_file_get_string (key_file, "Loader",
+ list[i], NULL);
- if (strcmp (list[i], "Type") == 0)
- {
- info->loader_type = value;
- continue;
- }
+ if (strcmp (list[i], "Type") == 0)
+ {
+ info->loader_type = value;
+ continue;
+ }
- attr_quark = g_quark_from_string (list[i]);
+ attr_quark = g_quark_from_string (list[i]);
- g_datalist_id_set_data_full (&info->loader_attributes,
- attr_quark, value,
- (GDestroyNotify) g_free);
- }
+ g_datalist_id_set_data_full (&info->loader_attributes,
+ attr_quark, value,
+ (GDestroyNotify) g_free);
+ }
g_strfreev (list);
+ }
g_key_file_free (key_file);