Skip to content

Commit

Permalink
git-config --rename-section could rename wrong section
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Roskin authored and Junio C Hamano committed Feb 4, 2007
1 parent 3b0f5e8 commit 9673a0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9673a0b

Please sign in to comment.