Fix cfg_del_section() function that was recently broken.
authorJustin Pettit <jpettit@nicira.com>
Fri, 13 Mar 2009 23:36:20 +0000 (16:36 -0700)
committerJustin Pettit <jpettit@nicira.com>
Fri, 13 Mar 2009 23:37:50 +0000 (16:37 -0700)
This was showing up when the bridge compatibiity module was attempting
to delete a bridge.

lib/cfg.c

index 67f8152a78ea31afdaacca9feb2e2739c3a6192c..0bb50b42fce7fe7229be2c344bda60b706d837fe 100644 (file)
--- a/lib/cfg.c
+++ b/lib/cfg.c
@@ -516,10 +516,10 @@ cfg_del_section(const char *section_, ...)
     ds_put_char(&section, '.');
     va_end(args);
 
-    for (p = find_key_le(ds_cstr(&section));
-         *p && !strncmp(section.string, *p, section.length);
-         p++) {
-        svec_del(&cfg, *p);
+    for (p = cfg.names; *p; p++) { /* XXX this is inefficient */
+        if (!strncmp(section.string, *p, section.length)) {
+            svec_del(&cfg, *p);
+        }
     }
     ds_destroy(&section);
     dirty = true;