aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c
index ea59761..439a869 100644
--- a/src/config.c
+++ b/src/config.c
@@ -325,8 +325,7 @@ static bool config_read_list(const char *value, char ***result)
return true;
}
-static config_status_t config_read_block(const block_scheme_t *scheme, block_t *block, const char **type,
- const char *key, const char *value)
+static config_status_t config_read_block(block_t *block, const char **type, const char *key, const char *value)
{
const char *section = "block";
size_t index = 0;
@@ -342,10 +341,10 @@ static config_status_t config_read_block(const block_scheme_t *scheme, block_t *
status = config_read_entry(block_text_entries, block, &index, section, block->label, key, value);
*type = config_type_to_string(block_entries[index].type);
- if (status != CONFIG_UNKNOWN || scheme->entries == NULL)
+ if (status != CONFIG_UNKNOWN || block->scheme->entries == NULL)
return status;
- status = config_read_entry(scheme->entries, block, &index, section, block->label, key, value);
+ status = config_read_entry(block->scheme->entries, block, &index, section, block->label, key, value);
*type = config_type_to_string(block_entries[index].type);
return status;
}
@@ -544,8 +543,6 @@ int config_read(config_t *config, FILE *file)
bool bar_section = false;
action_t *action = NULL;
-
- const block_scheme_t *scheme = NULL;
block_t *block = NULL;
if (section != NULL) {
@@ -596,8 +593,7 @@ int config_read(config_t *config, FILE *file)
if (strcmp(block_schemes[i]->name, value))
continue;
- scheme = block_schemes[i];
- block = config_alloc_block(config, scheme, label);
+ block = config_alloc_block(config, block_schemes[i], label);
goto skip_pair;
}
@@ -668,7 +664,7 @@ int config_read(config_t *config, FILE *file)
}
if (block != NULL) {
- status = config_read_block(scheme, block, &type, key, value);
+ status = config_read_block(block, &type, key, value);
}
if (action != NULL) {