return strlen(s) ? s : NULL;
}
+/**
+ * conf_replace_char - replace one char with another.
+ */
+
+char *conf_replace_char(char *s, char from, char to)
+{
+ if (!s)
+ return NULL;
+
+ for ( ; *s; s++)
+ if (*s == from)
+ *s = to;
+
+ return s;
+}
+
/**
* conf_get_param_pair - Get the next 'name=value' parameter pair.
* @str: The string to process.
return 0;
}
+/**
+ * conf_init_global_options - Zero the global option table.
+ */
+
+void conf_init_global_options(struct conf_context *conf)
+{
+ int i;
+
+ for (i = 0; conf->global_options[i].name; i++)
+ conf->global_options[i].value = NULL;
+}
+
/**
* conf_set_global_option - Set a value in the global option table.
*
if (streq(name, conf->global_options[i].name)) {
conf->global_options[i].value
= talloc_strdup(conf, value);
- pb_log("%s: %s:%s\n", __func__, name, value);
+ pb_log("%s: @%s@%s@\n", __func__, name, value);
return 1;
}
}
int i;
for (i = 0; conf->global_options[i].name ;i++)
- if (streq(name, conf->global_options[i].name))
+ if (streq(name, conf->global_options[i].name)) {
+ pb_log("%s: @%s@%s@\n", __func__, name,
+ conf->global_options[i].value);
return conf->global_options[i].value;
+ }
assert(0 && "unknown global name");
return NULL;
if (*value == '#')
continue;
- value = conf_strip_str(value);
-
- if (!value)
- continue;
-
conf->process_pair(conf, name, value);
}