]> git.proxmox.com Git - libgit2.git/commitdiff
build_varname: lowercase the variable name
authorCarlos Martín Nieto <cmn@elego.de>
Wed, 30 Mar 2011 14:22:31 +0000 (16:22 +0200)
committerCarlos Martín Nieto <cmn@elego.de>
Thu, 31 Mar 2011 13:05:12 +0000 (15:05 +0200)
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
src/config.c

index 71a173f47563d1d8911d530312048c60db78d735..41c4d3a8e9582ccb6f0f9a1d06be8e447a97906e 100644 (file)
@@ -686,9 +686,10 @@ static int config_parse(git_config *cfg_file)
 }
 
 /*
- * Gives $section.$name back, using only name_len chars from the name,
- * which is useful so we don't have to copy the variable name twice.
- * Don't forget to free the memory you get.
+ * 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. 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)
 {
@@ -703,6 +704,9 @@ static char *build_varname(const char *section, const char *name, int name_len)
                return NULL;
 
        ret = snprintf(varname, total_len, "%s.%s", section, name);
+       if(ret >= 0){
+               strtolower(varname + section_len + 1);
+       }
 
        return varname;
 }