if (found) {
ini->items[i].val.int64val = ua->int64_val;
}
+
+ } else if (h == ini_store_alist_str) {
+ found = ini->items[i].found = get_cmd(ua, prompt.c_str());
+ if (found) {
+ if (!ini->items[i].val.alistval) {
+ ini->items[i].val.alistval = New(alist(10, owned_by_alist));
+ }
+ ini->items[i].val.alistval->append(bstrdup(ua->cmd));
+ }
}
goto configure_again;
}
if (items[i].found) {
/* special members require delete or free */
if (items[i].handler == ini_store_str) {
- free(items[i].val.strval);
- items[i].val.strval = NULL;
+ bfree_and_null(items[i].val.strval);
} else if (items[i].handler == ini_store_alist_str) {
- delete items[i].val.alistval;
- items[i].val.alistval = NULL;
+ bdelete_and_null(items[i].val.alistval);
}
items[i].found = false;
}
{
alist *list = item->val.alistval;
if (!lc) {
- /* TODO, write back the alist to edit buffer */
+ bool first=true;
+ char *str;
+ pm_strcpy(inifile->edit, "");
+ if (list) {
+ POOL_MEM tmp;
+ foreach_alist(str, list) {
+ if (first) {
+ first = false;
+ } else {
+ pm_strcat(inifile->edit, ",");
+ }
+ pm_strcat(inifile->edit, quote_string(tmp.addr(), str));
+ }
+ }
return true;
}