Merge pull request #199 from ailin-nemui/config-parser

Make config parser more robust
This commit is contained in:
Alexander Færøy 2015-04-17 21:23:03 +02:00
commit eb0f09073c
22 changed files with 119 additions and 66 deletions

View file

@ -104,6 +104,12 @@ void config_node_set_str(CONFIG_REC *rec, CONFIG_NODE *parent, const char *key,
return;
}
if (node != NULL && !has_node_value(node)) {
g_critical("Expected scalar node at `..%s/%s' was of complex type. Corrupt config?",
parent->key, key);
config_node_remove(rec, parent, node);
node = NULL;
}
if (node != NULL) {
if (g_strcmp0(node->value, value) == 0)
return;