degesch: skip unrecognized config items in /set

This commit is contained in:
Přemysl Eric Janouch 2015-07-16 20:40:10 +02:00
parent 6f3b48e4eb
commit 1b56b4ee72
1 changed files with 5 additions and 1 deletions

View File

@ -6399,6 +6399,11 @@ config_dump_item (struct config_item_ *item, struct config_dump_data *data)
return; return;
} }
// Currently there's no reason for us to dump unknown items
struct config_schema *schema = item->schema;
if (!schema)
return;
struct str line; struct str line;
str_init (&line); str_init (&line);
@ -6416,7 +6421,6 @@ config_dump_item (struct config_item_ *item, struct config_dump_data *data)
config_item_write (item, false, &value); config_item_write (item, false, &value);
// Don't bother writing out null values everywhere // Don't bother writing out null values everywhere
struct config_schema *schema = item->schema;
bool has_default = schema && schema->default_; bool has_default = schema && schema->default_;
if (item->type != CONFIG_ITEM_NULL || has_default) if (item->type != CONFIG_ITEM_NULL || has_default)
{ {