From 9b9c5196a7a4572a833eed569b4ffd9ee2aa1921 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 23 Feb 2022 15:40:22 -0500 Subject: Fixed core dump when compiled with -D_GLIBCXX_ASSERTIONS --- src/bible.cc | 2 +- src/lib/mods.cc | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/bible.cc b/src/bible.cc index 4da2326..c2d93b1 100644 --- a/src/bible.cc +++ b/src/bible.cc @@ -308,7 +308,7 @@ int main(int argc, char* argv[]) { chapter = tex.chapter; verse = tex.verse; out << tex.text; - if(tex.text.back() == '\n') { + if(!tex.text.empty() and tex.text.back() == '\n') { isNewline = true; } else { isNewline = false; diff --git a/src/lib/mods.cc b/src/lib/mods.cc index ab54e48..07f48da 100644 --- a/src/lib/mods.cc +++ b/src/lib/mods.cc @@ -161,14 +161,6 @@ bool libbible::installModFromInternet(string language, string name) { #define delim '/' bool libbible::installModFromZip(string filename) { - // So... turns out it's a mite unsupported to install from a .zip - // Here's the deal. We do a syscall to unzip. We fancy like that. - // TODO: Use the ZipCompress module from SWORD instead. - /*string command = "unzip -o " + filename + " -d " + basedir + "&> /dev/null"; - if(system(command.c_str())) { - //Uh oh... - printf("Something bad happened when unpacking %s\n. Is unzip installed?", filename.c_str()); - }*/ unzFile zipfile = unzOpen(filename.c_str()); if(zipfile == NULL) { return false; -- cgit v1.2.3