snprintf(n->name, sizeof(n->name), "%s", tok->str);
n->ops = &confnode_menu.ops;
n->flags = CONFNODE_F_IS_DIR;
+ snprintf(n->default_value, sizeof(n->default_value), "y");
return 0;
}
static int confnode_menu_dotconfig_write(const struct confnode *n, FILE *f)
{
const struct confnode *c;
- int val;
- val = confnode_get_value(n, NULL, 0);
- if (val < 0)
+ if (fprintf(f, "#\n# -- %s\n#\n", n->prompt) < 0)
return -1;
- if (val == 0)
- return 0;
TAILQ_FOREACH(c, &n->children, next) {
if (confnode_dotconfig_write(c, f) < 0)
/* Print a one-line summary of the node. Used in case of 'ls'. */
static void confnode_menu_display_short(const struct confnode *n)
{
- printf(" -> %s: %s\n", n->name, n->prompt);
+ printf(" -> %s: %s\n", n->name, n->prompt);
}
/* Print a detailed view of the node. */
printf(" path ");
conf_display_path(n);
printf(" \"%s\"\n", n->prompt);
- printf(" no value\n");
}
/* register the node type */