* [PATCH] git-config --rename-section could rename wrong section
@ 2007-02-04 3:01 Pavel Roskin
0 siblings, 0 replies; only message in thread
From: Pavel Roskin @ 2007-02-04 3:01 UTC (permalink / raw)
To: git
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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-02-04 3:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-04 3:01 [PATCH] git-config --rename-section could rename wrong section Pavel Roskin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).