From f6fdaf8e9a5fa2937d58523c5250958c8a0f6502 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 11 Aug 2004 10:11:38 +0000
Subject: [PATCH] iniRenameSection() returns FALSE if attempting to rename to
 an existing (duplicate) section name.

---
 src/xpdev/ini_file.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c
index 974c726ec8..bf120aa4d2 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -280,6 +280,10 @@ BOOL iniRenameSection(str_list_t* list, const char* section, const char* newname
 	if(section==ROOT_SECTION)
 		return(FALSE);
 
+	i=find_section_index(*list,newname);
+	if((*list)[i]!=NULL)	/* duplicate */
+		return(FALSE);
+
 	i=find_section_index(*list,section);
 	if((*list)[i]==NULL)	/* not found */
 		return(FALSE);
-- 
GitLab