diff options
| author | Carlos Martín Nieto <cmn@elego.de> | 2011-03-30 16:02:57 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@elego.de> | 2011-03-31 15:05:12 +0200 |
| commit | 923fe4557f441f1cb94e02acda527d2785726afa (patch) | |
| tree | 531e43051a9820b0decd1147978276f294313d3b /src/config.c | |
| parent | df22949a3566e2514c963d9eec2f0e82c05a18e9 (diff) | |
| download | libgit2-923fe4557f441f1cb94e02acda527d2785726afa.tar.gz | |
Add strtolower and strntolower functions
As parts of variable names are case-sensitive, we need these functions.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index 0870ce620..4c4db91af 100644 --- a/src/config.c +++ b/src/config.c @@ -70,6 +70,20 @@ static git_cvar *cvar_list_find(git_cvar *start, const char *name) return NULL; } +void strntolower(char *str, int len) +{ + int i; + + for (i = 0; i < len; ++i) { + str[len] = tolower(str[len]); + } +} + +void strtolower(char *str) +{ + strntolower(str, strlen(str)); +} + int git_config_open(git_config **cfg_out, const char *path) { git_config *cfg; @@ -544,6 +558,7 @@ static int parse_section_header(git_config *cfg, char **section_out, const char } name[name_length] = 0; + strtolower(name); *section_out = name; return GIT_SUCCESS; |
