Skip to content

Commit

Permalink
housekeeping: Fix incorrect handling of ignore_paths
Browse files Browse the repository at this point in the history
You can't use G_N_ELEMENTS() on a non-static array.

Also use a guint to iterate, and prepend to the list (which
is quicker than appending for long lists).
  • Loading branch information
hadess committed Feb 20, 2013
1 parent c218b18 commit 8ed86ae
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plugins/housekeeping/gsd-disk-space.c
Expand Up @@ -965,12 +965,10 @@ gsd_ldsm_get_config (void)

settings_list = g_settings_get_strv (settings, SETTINGS_IGNORE_PATHS);
if (settings_list != NULL) {
gint i;
guint i;

for (i = 0; i < G_N_ELEMENTS (settings_list); i++) {
if (settings_list[i] != NULL)
ignore_paths = g_slist_append (ignore_paths, g_strdup (settings_list[i]));
}
for (i = 0; i < settings_list[i] != NULL; i++)
ignore_paths = g_slist_prepend (ignore_paths, g_strdup (settings_list[i]));

/* Make sure we dont leave stale entries in ldsm_notified_hash */
g_hash_table_foreach_remove (ldsm_notified_hash,
Expand Down

0 comments on commit 8ed86ae

Please sign in to comment.