Skip to content
Snippets Groups Projects
Commit 93cddc01 authored by rswindell's avatar rswindell
Browse files

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
parent 09d5ae7f
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment