aboutsummaryrefslogtreecommitdiff
path: root/mods.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-01-22 11:25:31 -0500
committerYour Name <you@example.com>2022-01-22 11:25:31 -0500
commit07da526d1263467dd87ca4e5a7bcfefda555f741 (patch)
tree5ac41a900a3bd930259fe60ff1ce998e36ef210e /mods.cc
parentb8a4092aaa48d00d88765021a82d5f396ba08f0f (diff)
downloadlibbible-07da526d1263467dd87ca4e5a7bcfefda555f741.tar.gz
libbible-07da526d1263467dd87ca4e5a7bcfefda555f741.tar.bz2
libbible-07da526d1263467dd87ca4e5a7bcfefda555f741.zip
Does not contain blank languages
Diffstat (limited to 'mods.cc')
-rw-r--r--mods.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/mods.cc b/mods.cc
index 708f3f1..ab54e48 100644
--- a/mods.cc
+++ b/mods.cc
@@ -118,11 +118,12 @@ map<string, vector<string>> libbible::downloadModsAvailable() {
}
string selected = fulls[0];
for(auto full : fulls) {
- if(majVote[full] > majVote[selected] or (majVote[full] == majVote[selected] and full.size() < selected.size())) {
+ if(majVote[full] > majVote[selected] or (majVote[full] == majVote[selected] and !full.empty() and full.size() < selected.size())) {
selected = full;
}
}
- languageNames[abbrev] = selected;
+ if(selected.empty()) languageNames[abbrev] = abbrev;
+ else languageNames[abbrev] = selected;
}
return modsAvailable;
}