mirror of
https://github.com/Dushistov/sdcv.git
synced 2026-01-05 01:44:28 +00:00
Compare commits
2 Commits
488ec68854
...
6e36e7730c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e36e7730c | ||
|
|
abe5e9e72f |
18
src/sdcv.cpp
18
src/sdcv.cpp
@@ -186,10 +186,13 @@ try {
|
||||
}
|
||||
|
||||
// add bookname to list
|
||||
gchar **p = get_impl(use_dict_list);
|
||||
while (*p) {
|
||||
order_list.push_back(bookname_to_ifo.at(*p));
|
||||
++p;
|
||||
for (gchar **p = get_impl(use_dict_list); *p != nullptr; ++p) {
|
||||
auto it = bookname_to_ifo.find(*p);
|
||||
if (it != bookname_to_ifo.end()) {
|
||||
order_list.push_back(it->second);
|
||||
} else {
|
||||
fprintf(stderr, _("Unknown dictionary: %s\n"), *p);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
std::string ordering_cfg_file = std::string(g_get_user_config_dir()) + G_DIR_SEPARATOR_S "sdcv_ordering";
|
||||
@@ -201,7 +204,12 @@ try {
|
||||
if (ordering_file != nullptr) {
|
||||
std::string line;
|
||||
while (stdio_getline(ordering_file, line)) {
|
||||
order_list.push_back(bookname_to_ifo.at(line));
|
||||
auto it = bookname_to_ifo.find(line);
|
||||
if (it != bookname_to_ifo.end()) {
|
||||
order_list.push_back(it->second);
|
||||
} else {
|
||||
fprintf(stderr, _("Unknown dictionary: %s\n"), line.c_str());
|
||||
}
|
||||
}
|
||||
fclose(ordering_file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user