From 93cddc017d38508ae47b8d5e33f3a8f4aa438414 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sat, 23 Oct 2004 00:35:02 +0000
Subject: [PATCH] Bugfixes to iniReadStringList(): * If a default value of NULL
 is passed and there is no key (or the value is   blank), NULL is returned,
 rather than single value of "(null)" * White-space chars prepended to values
 following separators are now stripped

---
 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 4a599a0059..21ac211196 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -506,6 +506,7 @@ static str_list_t splitList(char* list, const char* sep)
 
 	token=strtok(list,sep);
 	while(token!=NULL) {
+		SKIP_WHITESPACE(token);
 		truncsp(token);
 		if(strListAppend(&lp,token,items++)==NULL)
 			break;
@@ -525,6 +526,9 @@ str_list_t iniReadStringList(FILE* fp, const char* section, const char* key
 	if((value=read_value(fp,section,key,buf))==NULL || *value==0 /* blank */)
 		value=(char*)deflt;
 
+	if(value==NULL)
+		return(NULL);
+
 	SAFECOPY(list,value);
 
 	return(splitList(list,sep));
-- 
GitLab