summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/config.c b/config.c
index 617b2e3cf4..a23f260792 100644
--- a/config.c
+++ b/config.c
@@ -2531,11 +2531,10 @@ int parse_config_key(const char *var,
const char **subsection, int *subsection_len,
const char **key)
{
- int section_len = strlen(section);
const char *dot;
/* Does it start with "section." ? */
- if (!starts_with(var, section) || var[section_len] != '.')
+ if (!skip_prefix(var, section, &var) || *var != '.')
return -1;
/*
@@ -2547,12 +2546,12 @@ int parse_config_key(const char *var,
*key = dot + 1;
/* Did we have a subsection at all? */
- if (dot == var + section_len) {
+ if (dot == var) {
*subsection = NULL;
*subsection_len = 0;
}
else {
- *subsection = var + section_len + 1;
+ *subsection = var + 1;
*subsection_len = dot - *subsection;
}