git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-config --rename-section could rename wrong section

From
PRPavel Roskin <proski@gnu.org>
Date
Feb 4, 2007, 03:01 UTC
Message-ID
<20070204030104.26499.77905.stgit@dv.roinet.com>

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>
---
 config.c |    2 +-
 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);
Message 1 of 1 in “git-config --rename-section could rename wrong section”
  1. git-config --rename-section could rename wrong sectionPavel Roskin, Feb 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.