#define THIS_MODULE VLM_cfg
#include "vlog.h"
+/* XXX This file really needs a unit test! For a while, cfg_get_string(0,
+ * "bridge.a.controller") would return the value of
+ * "bridge.a.controller.in-band", if it existed, and I'm really not certain
+ * that the fix didn't break other things (e.g. cfg_has_section()). */
+
/* List of configuration files. */
static struct svec cfg_files = SVEC_EMPTY_INITIALIZER;
compare_key(const char *a, const char *b)
{
for (;;) {
- int ac = *a == '=' ? '\0' : *a;
- int bc = *b == '=' ? '\0' : *b;
+ int ac = *a == '=' ? INT_MAX : *a;
+ int bc = *b == '=' ? INT_MAX : *b;
if (ac != bc) {
return ac < bc ? -1 : 1;
- } else if (!ac) {
+ } else if (ac == INT_MAX) {
return 0;
}
a++;