From: Pavel Roskin Date: Sun, 4 Feb 2007 03:01:04 +0000 (-0500) Subject: git-config --rename-section could rename wrong section X-Git-Tag: v1.5.0-rc4~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9673a0b182fdb39e6a00e2cbdcfacee769201053;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/config.c b/config.c index c08c66890..d82107124 100644 --- a/config.c +++ b/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++]) break; } - if (buf[i] == ']') { + if (buf[i] == ']' && old_name[j] == 0) { /* old_name matches */ ret++; store.baselen = strlen(new_name);