git-config --rename-section could rename wrong section
The "git-config --rename-section" implementation would match sections that are substrings of the section name to be renamed. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>maint
parent
3b0f5e88ee
commit
9673a0b182
2
config.c
2
config.c
|
@ -896,7 +896,7 @@ int git_config_rename_section(const char *old_name, const char *new_name)
|
||||||
if (buf[i] != old_name[j++])
|
if (buf[i] != old_name[j++])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (buf[i] == ']') {
|
if (buf[i] == ']' && old_name[j] == 0) {
|
||||||
/* old_name matches */
|
/* old_name matches */
|
||||||
ret++;
|
ret++;
|
||||||
store.baselen = strlen(new_name);
|
store.baselen = strlen(new_name);
|
||||||
|
|
Loading…
Reference in New Issue