mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 18:11:43 +00:00
config: move str(n)tolower to the git__ namespace
Non-static functions in a library should always have a prefix namespace. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
aa793424d3
commit
acab3bc474
12
src/config.c
12
src/config.c
@ -157,7 +157,7 @@ static int cvar_name_normalize(const char *input, char **output)
|
|||||||
return GIT_SUCCESS;
|
return GIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void strntolower(char *str, int len)
|
void git__strntolower(char *str, int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -166,9 +166,9 @@ void strntolower(char *str, int len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void strtolower(char *str)
|
void git__strtolower(char *str)
|
||||||
{
|
{
|
||||||
strntolower(str, strlen(str));
|
git__strntolower(str, strlen(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_config_open(git_config **cfg_out, const char *path)
|
int git_config_open(git_config **cfg_out, const char *path)
|
||||||
@ -638,7 +638,7 @@ static char *build_varname(const char *section, const char *name)
|
|||||||
if (ret >= 0) { /* lowercase from the last dot onwards */
|
if (ret >= 0) { /* lowercase from the last dot onwards */
|
||||||
char *dot = strrchr(varname, '.');
|
char *dot = strrchr(varname, '.');
|
||||||
if (dot != NULL)
|
if (dot != NULL)
|
||||||
strtolower(dot);
|
git__strtolower(dot);
|
||||||
}
|
}
|
||||||
|
|
||||||
return varname;
|
return varname;
|
||||||
@ -713,7 +713,7 @@ static int parse_section_header_ext(const char *line, const char *base_name, cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
sprintf(*section_name, "%s %s", base_name, subsection);
|
sprintf(*section_name, "%s %s", base_name, subsection);
|
||||||
strntolower(*section_name, strchr(*section_name, ' ') - *section_name);
|
git__strntolower(*section_name, strchr(*section_name, ' ') - *section_name);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
free(subsection);
|
free(subsection);
|
||||||
@ -778,7 +778,7 @@ static int parse_section_header(git_config *cfg, char **section_out)
|
|||||||
|
|
||||||
name[name_length] = 0;
|
name[name_length] = 0;
|
||||||
free(line);
|
free(line);
|
||||||
strtolower(name);
|
git__strtolower(name);
|
||||||
*section_out = name;
|
*section_out = name;
|
||||||
return GIT_SUCCESS;
|
return GIT_SUCCESS;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ struct git_cvar {
|
|||||||
#define CVAR_LIST_FOREACH(start, iter) \
|
#define CVAR_LIST_FOREACH(start, iter) \
|
||||||
for ((iter) = (start); (iter) != NULL; (iter) = (iter)->next)
|
for ((iter) = (start); (iter) != NULL; (iter) = (iter)->next)
|
||||||
|
|
||||||
void strtolower(char *str);
|
void git__strtolower(char *str);
|
||||||
void strntolower(char *str, int len);
|
void git__strntolower(char *str, int len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user