提交 9673a0b1 编写于 作者: P Pavel Roskin 提交者: Junio C Hamano

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: NPavel Roskin <proski@gnu.org>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 3b0f5e88
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册