mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 09:41:04 +00:00
config: don't use 'section "subsection"' internal form on config_set
This had been left over from a time when I believed what the git documentation had to say about case-sensitivity. The rest of the code doesn't recognize this form and we hadn't noticed because most tests don't try to get a recently-set variable but free and reload the configuration, causing the right format to be used.
This commit is contained in:
parent
19313a76b6
commit
a9fe8ae0ee
@ -230,23 +230,13 @@ static char *interiorize_section(const char *orig)
|
||||
if (last_dot == dot)
|
||||
return git__strndup(orig, dot - orig);
|
||||
|
||||
section = git__malloc(len + 4);
|
||||
section = git__strndup(orig, len);
|
||||
if (section == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(section, 0x0, len + 4);
|
||||
ret = section;
|
||||
len = dot - orig;
|
||||
memcpy(section, orig, len);
|
||||
section += len;
|
||||
len = strlen(" \"");
|
||||
memcpy(section, " \"", len);
|
||||
section += len;
|
||||
len = last_dot - dot - 1;
|
||||
memcpy(section, dot + 1, len);
|
||||
section += len;
|
||||
*section = '"';
|
||||
|
||||
git__strntolower(section, len);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user