Fix bug where only the first valid config token is loaded from the config
authorAlex Graveley <alex@ximian.com>
Mon, 30 Jul 2001 22:35:25 +0000 (22:35 +0000)
committerAlex Graveley <orph@src.gnome.org>
Mon, 30 Jul 2001 22:35:25 +0000 (22:35 +0000)
2001-07-30  Alex Graveley  <alex@ximian.com>

* src/soup-core/soup-misc.c (soup_load_config_internal): Fix bug
where only the first valid config token is loaded from the config file.

ChangeLog
libsoup/soup-misc.c

index 1a08cb3..df250db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2001-07-30  Alex Graveley  <alex@ximian.com>
 
+       * src/soup-core/soup-misc.c (soup_load_config_internal): Fix bug
+       where only the first valid config token is loaded from the config file.
+
+2001-07-30  Alex Graveley  <alex@ximian.com>
+
        * src/soup-core/soup-socket.c (soup_address_new_cb): Fix dangling
        pointer error where a resolved SoupAddress is passed to the callback,
        and then realloc'd.
index 5dca235..73f1775 100644 (file)
@@ -342,7 +342,7 @@ soup_config_token_allowed (gchar *key)
 static void
 soup_load_config_internal (gchar *config_file, gboolean admin)
 {
-       struct SoupConfigFuncs *funcs = soup_config_funcs;
+       struct SoupConfigFuncs *funcs;
        FILE *cfg;
        char buf[128];
 
@@ -381,9 +381,11 @@ soup_load_config_internal (gchar *config_file, gboolean admin)
                key = g_strchomp (split[0]);
                value = g_strchug (split[1]);
 
-               for (; funcs && funcs->key; funcs++)
-                       if (!g_strcasecmp (key, funcs->key))
+               for (funcs = soup_config_funcs; funcs && funcs->key; funcs++)
+                       if (!g_strcasecmp (key, funcs->key)) {
                                funcs->func (key, value);
+                               break;
+                       }
 
                g_strfreev (split);
        }