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>
Pavel Roskin committed
Feb 3, 2007 at 22:01 UTC
9673a0b182fdb39e6a00e2cbdcfacee769201053
1 file changed
+1
-1
config.c
+1
-1
@@ -896,7 +896,7 @@ int git_config_rename_section(const char *old_name, const char *new_name)
896
if (buf[i] != old_name[j++])
897
break;
898
}
899
- if (buf[i] == ']') {
899
+ if (buf[i] == ']' && old_name[j] == 0) {
900
/* old_name matches */
901
ret++;
902
store.baselen = strlen(new_name);