Commit d28830c2 by Carlos Martín Nieto

Store the parsed variables

Store the key-value pair as strings.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
parent 934fcf78
......@@ -661,9 +661,9 @@ static char *build_varname(const char *section, const char *name, int name_len)
static int parse_variable(git_config *cfg, const char *section_name, const char *line)
{
int error;
int error = GIT_SUCCESS;
int has_value = 1;
const char *varname;
char *varname;
const char *var_end = NULL;
const char *value_start = NULL;
......@@ -690,8 +690,14 @@ static int parse_variable(git_config *cfg, const char *section_name, const char
}
varname = build_varname(section_name, line, var_end - line + 1);
if(varname == NULL)
return GIT_ENOMEM;
return GIT_SUCCESS;
config_set(cfg, varname, value_start);
free(varname);
return error;
error:
return GIT_EOBJCORRUPTED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment