char *val;
int param = 0;
const char *id = NULL, *type = NULL;
- char *name;
+ char *name, *alt_name;
deque<const char*> args;
deque<const char *> sections;
argv_to_deq(argc, argv, args);
usage();
if (id) {
- name = (char *)malloc(strlen(type) + strlen(id) + 1);
-
+ name = (char *)malloc(strlen(type) + strlen(id) + 2);
sprintf(name, "%s.%s", type, id);
+ alt_name = (char *)malloc(strlen(type) + strlen(id) + 1);
+ sprintf(name, "%s%s", type, id);
} else {
name = (char *)type;
}
if (name)
sections.push_front(name);
+ if (alt_name)
+ sections.push_front(alt_name);
for (unsigned i=0; i<sections.size(); i++) {
cf.read(sections[i], key, (char **)&val, NULL);