mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +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
|
|
@ -66,7 +66,7 @@ static void hilight_add_config(HILIGHT_REC *rec)
|
|||
g_return_if_fail(rec != NULL);
|
||||
|
||||
node = iconfig_node_traverse("(hilights", TRUE);
|
||||
node = config_node_section(node, NULL, NODE_TYPE_BLOCK);
|
||||
node = iconfig_node_section(node, NULL, NODE_TYPE_BLOCK);
|
||||
|
||||
iconfig_node_set_str(node, "text", rec->text);
|
||||
if (rec->level > 0) iconfig_node_set_int(node, "level", rec->level);
|
||||
|
|
@ -81,7 +81,7 @@ static void hilight_add_config(HILIGHT_REC *rec)
|
|||
if (rec->servertag) iconfig_node_set_str(node, "servertag", rec->servertag);
|
||||
|
||||
if (rec->channels != NULL && *rec->channels != NULL) {
|
||||
node = config_node_section(node, "channels", NODE_TYPE_LIST);
|
||||
node = iconfig_node_section(node, "channels", NODE_TYPE_LIST);
|
||||
iconfig_node_add_list(node, rec->channels);
|
||||
}
|
||||
}
|
||||
|
|
@ -471,7 +471,7 @@ static void read_hilight_config(void)
|
|||
rec->servertag = config_node_get_str(node, "servertag", NULL);
|
||||
hilight_init_rec(rec);
|
||||
|
||||
node = config_node_section(node, "channels", -1);
|
||||
node = iconfig_node_section(node, "channels", -1);
|
||||
if (node != NULL) rec->channels = config_node_get_list(node);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue