mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 22:08:56 +00:00
build_varname: lowercase the variable name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
0bbaf9aaef
commit
d7354d70b0
10
src/config.c
10
src/config.c
@ -686,9 +686,10 @@ static int config_parse(git_config *cfg_file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Gives $section.$name back, using only name_len chars from the name,
|
* Returns $section.$name, using only name_len chars from the name,
|
||||||
* which is useful so we don't have to copy the variable name twice.
|
* which is useful so we don't have to copy the variable name
|
||||||
* Don't forget to free the memory you get.
|
* twice. The name of the variable is set to lowercase.
|
||||||
|
*Don't forget to free the buffer.
|
||||||
*/
|
*/
|
||||||
static char *build_varname(const char *section, const char *name, int name_len)
|
static char *build_varname(const char *section, const char *name, int name_len)
|
||||||
{
|
{
|
||||||
@ -703,6 +704,9 @@ static char *build_varname(const char *section, const char *name, int name_len)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ret = snprintf(varname, total_len, "%s.%s", section, name);
|
ret = snprintf(varname, total_len, "%s.%s", section, name);
|
||||||
|
if(ret >= 0){
|
||||||
|
strtolower(varname + section_len + 1);
|
||||||
|
}
|
||||||
|
|
||||||
return varname;
|
return varname;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user