cfg: Keep configuration sorted when adding entries.
authorBen Pfaff <blp@nicira.com>
Wed, 15 Apr 2009 22:02:02 +0000 (15:02 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 15 Apr 2009 22:02:02 +0000 (15:02 -0700)
Otherwise later cfg accesses are likely to assert-fail since the
configuration is no longer sorted.

lib/cfg.c

index d588e6423881bfbe34adf403e103352c0f9354cb..63bfe0d8d29508f100b38a3ab0a5a7cddf0e4d8b 100644 (file)
--- a/lib/cfg.c
+++ b/lib/cfg.c
@@ -500,6 +500,7 @@ cfg_add_entry(const char *entry_, ...)
 
     FORMAT_KEY(entry_, entry);
     svec_add_nocopy(&cfg, entry);
+    svec_sort(&cfg);
     svec_terminate(&cfg);
     dirty = true;
 }