summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2007-02-04 03:01:04 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-02-04 05:35:22 (GMT)
commit9673a0b182fdb39e6a00e2cbdcfacee769201053 (patch)
treef00c0cf98e3ba7cc2b5d9f41786a0147f905614b /config.c
parent3b0f5e88ee039e96822d7d0127a59d78936c222f (diff)
downloadgit-9673a0b182fdb39e6a00e2cbdcfacee769201053.zip
git-9673a0b182fdb39e6a00e2cbdcfacee769201053.tar.gz
git-9673a0b182fdb39e6a00e2cbdcfacee769201053.tar.bz2
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>
Diffstat (limited to 'config.c')
-rw-r--r--config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/config.c b/config.c
index c08c668..d821071 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);