PosibErr<Config *> find_word_list(Config * c)
{
- Config * config = new_config();
+ StackPtr<Config> config(new_config());
RET_ON_ERR(config->read_in_settings(c));
String dict_name;
else if (config->have("module-search-order"))
config->retrieve_list("module-search-order", &b_module.list);
{
- StackPtr<ModuleInfoEnumeration> els(get_module_info_list(config)->elements());
+ RET_ON_ERR_SET(get_module_info_list(config), const ModuleInfoList *, modules);
+ StackPtr<ModuleInfoEnumeration> els(modules->elements());
const ModuleInfo * entry;
while ( (entry = els->next()) != 0)
b_module.list.add(entry->name);
b_size.req_type = '+';
}
if (!asc_isdigit(p[0]) || !asc_isdigit(p[1]) || p[2] != '\0')
- abort(); //FIXME: create an error condition here
+ return make_err(aerror_bad_value, "size", str, "valid");
b_size.requested = atoi(p);
b_size.init();
//
if (best != 0) {
String main_wl,flags;
- PosibErrBase ret = get_dict_file_name(best, main_wl, flags);
- if (ret.has_err()) {
- delete config;
- return ret;
- }
+ RET_ON_ERR(get_dict_file_name(best, main_wl, flags));
dict_name = best->name;
config->replace("lang", b_code.best);
config->replace("language-tag", b_code.best);
}
config->replace("size", b_size.best_str);
} else {
- delete config;
return make_err(no_wordlist_for_lang, code);
}
}
const StringMap * dict_aliases = get_dict_aliases(config);
const char * val = dict_aliases->lookup(dict_name);
if (val) config->replace("master", val);
- return config;
+ return config.release();
}
PosibErr<void> reload_filters(Speller * m)