mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Merge pull request #199 from ailin-nemui/config-parser
Make config parser more robust
This commit is contained in:
commit
eb0f09073c
22 changed files with 119 additions and 66 deletions
|
|
@ -332,11 +332,11 @@ static void log_items_update_config(LOG_REC *log, CONFIG_NODE *parent)
|
|||
GSList *tmp;
|
||||
CONFIG_NODE *node;
|
||||
|
||||
parent = config_node_section(parent, "items", NODE_TYPE_LIST);
|
||||
parent = iconfig_node_section(parent, "items", NODE_TYPE_LIST);
|
||||
for (tmp = log->items; tmp != NULL; tmp = tmp->next) {
|
||||
LOG_ITEM_REC *rec = tmp->data;
|
||||
|
||||
node = config_node_section(parent, NULL, NODE_TYPE_BLOCK);
|
||||
node = iconfig_node_section(parent, NULL, NODE_TYPE_BLOCK);
|
||||
iconfig_node_set_str(node, "type", log_item_types[rec->type]);
|
||||
iconfig_node_set_str(node, "name", rec->name);
|
||||
iconfig_node_set_str(node, "server", rec->servertag);
|
||||
|
|
@ -352,7 +352,7 @@ static void log_update_config(LOG_REC *log)
|
|||
return;
|
||||
|
||||
node = iconfig_node_traverse("logs", TRUE);
|
||||
node = config_node_section(node, log->fname, NODE_TYPE_BLOCK);
|
||||
node = iconfig_node_section(node, log->fname, NODE_TYPE_BLOCK);
|
||||
|
||||
if (log->autoopen)
|
||||
iconfig_node_set_bool(node, "auto_open", TRUE);
|
||||
|
|
@ -544,7 +544,7 @@ static void log_read_config(void)
|
|||
|
||||
signal_emit("log config read", 2, log, node);
|
||||
|
||||
node = config_node_section(node, "items", -1);
|
||||
node = iconfig_node_section(node, "items", -1);
|
||||
if (node != NULL)
|
||||
log_items_read_config(node, log);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue