{"thread":{"id":"6654","subject":"[PATCH] git-config --rename-section could rename wrong section","startedAt":"2007-02-04T03:01:04Z","lastAt":"2007-02-04T03:01:04Z","messageCount":1,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"33522","messageId":"20070204030104.26499.77905.stgit@dv.roinet.com","threadId":"6654","inReplyTo":null,"subject":"[PATCH] git-config --rename-section could rename wrong section","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-04T03:01:04Z","receivedAt":"2007-02-04T03:01:04Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"The \"git-config --rename-section\" implementation would match sections\nthat are substrings of the section name to be renamed.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n config.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex c08c668..d821071 100644\n--- a/config.c\n+++ b/config.c\n@@ -896,7 +896,7 @@ int git_config_rename_section(const char *old_name, const char *new_name)\n \t\t\t\tif (buf[i] != old_name[j++])\n \t\t\t\t\tbreak;\n \t\t\t}\n-\t\t\tif (buf[i] == ']') {\n+\t\t\tif (buf[i] == ']' && old_name[j] == 0) {\n \t\t\t\t/* old_name matches */\n \t\t\t\tret++;\n \t\t\t\tstore.baselen = strlen(new_name);\n"}]}