diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index e4e91fb..85ceca8 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -340,9 +340,9 @@ gtk_settings_init (GtkSettings *settings)
   g_free (path);
 
   config_dirs = g_get_system_config_dirs ();
-  for (config_dir = *config_dirs; *config_dirs != NULL; config_dirs++)
+  for (; *config_dirs != NULL; config_dirs++)
     {
-      path = g_build_filename (config_dir, "gtk-3.0", "settings.ini", NULL);
+      path = g_build_filename (*config_dirs, "gtk-3.0", "settings.ini", NULL);
       if (g_file_test (path, G_FILE_TEST_EXISTS))
         gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
       g_free (path);
