From 92c1489022c52c21c9acc268b292acb7b1f66aed Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sun, 17 Jun 2007 03:11:29 +0000
Subject: [PATCH] Bug-fix: iniGetExistingString() was zeroing out the value
 even if the key didn't exist.

---
 src/xpdev/ini_file.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c
index 1ce9cf803d..62e25f7236 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -689,20 +689,10 @@ char* iniReadExistingString(FILE* fp, const char* section, const char* key, cons
 
 char* iniGetExistingString(str_list_t list, const char* section, const char* key, const char* deflt, char* value)
 {
-	size_t	i;
-
-	if(list==NULL)
+	if(!iniKeyExists(list, section, key))
 		return(NULL);
 
-	i=get_value(list, section, key, value);
-
-	if(list[i]==NULL || *(list[i])==INI_OPEN_SECTION_CHAR)	/* missing key */
-		return(NULL);
-
-	if(*value==0 /* blank value  */)
-		return default_value(deflt,value);
-
-	return(value);
+	return iniGetString(list, section, key, deflt, value);
 }
 
 static str_list_t splitList(char* list, const char* sep)
-- 
GitLab