From 98a682d32fe2726fed287151945f77665e13e98a Mon Sep 17 00:00:00 2001 From: arik Date: Wed, 24 May 2000 17:27:09 +0000 Subject: [PATCH] Jacob the all-knowing all-seeing eye found a bug which Ian and Arik (masters of all things gdb) scorched... fixed recreate desktop icons in gdesktop-init.c:(desktop_load_init_from) --- gnome/ChangeLog | 5 +++++ gnome/gdesktop-init.c | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index deefa5e76..9470c04c5 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,8 @@ +2000-05-24 Arik Devens and Ian Peters + + * gdesktop-init.c (desktop_load_init_from): don't crash on + recreating icons, iterating over NULL pointer. + 2000-05-15 Andrew Post * gdesktop.c (get_icon_snap_pos): Icons no longer count themselves diff --git a/gnome/gdesktop-init.c b/gnome/gdesktop-init.c index 728b402f5..c1ed231bb 100644 --- a/gnome/gdesktop-init.c +++ b/gnome/gdesktop-init.c @@ -19,22 +19,22 @@ static void desktop_load_init_from (const char *file) { + char *key; + char *file_and_section; + char *title, *type; + void *iterator_handle; char *config_path = g_strconcat ("=", file, "=", NULL); iterator_handle = gnome_config_init_iterator_sections (config_path); + iterator_handle = gnome_config_iterator_next ( + iterator_handle, &key, NULL); + do { - char *key; - char *file_and_section; - char *title, *type; - - /* Get next section name */ - iterator_handle = gnome_config_iterator_next ( - iterator_handle, &key, NULL); - /* Now access the values in the section */ file_and_section = g_strconcat (config_path, "/", key, "/", NULL); + gnome_config_push_prefix (file_and_section); title = gnome_config_get_translated_string ("title=None"); type = gnome_config_get_string ("type=url"); @@ -71,6 +71,11 @@ desktop_load_init_from (const char *file) g_free (title); g_free (file_and_section); gnome_config_pop_prefix (); + + /* Get next section name */ + iterator_handle = gnome_config_iterator_next ( + iterator_handle, &key, NULL); + } while (iterator_handle); g_free (config_path);