- if(cfsections>=MAX_SECTIONS)
- die("too many modules %d",cfsections);
- cfsection[cfsections].section=section;
- cfsection[cfsections].items=items;
- cfsections++;
+ struct cfitem *item, *section;
+
+ item=cfsection;
+ while(item && strcasecmp(item->name,sect))
+ item=item->var;
+ if(!item) /* unknown section */
+ return NULL;
+ section = item;
+
+ for(item++; item->type && strcasecmp(item->name,name); item++);
+ if (!item->type && section->type == CT_INCOMPLETE_SECTION)
+ return NULL;
+
+ return item; /* item->type == 0 if not found */